diff options
| author | Juri Linkov | 2025-04-29 19:35:30 +0300 |
|---|---|---|
| committer | Juri Linkov | 2025-04-29 19:35:30 +0300 |
| commit | 622825995204b7aae70b836c8e5e5d44385c401b (patch) | |
| tree | cc742974fd02c7193eee45589ef91f4a45e4b206 | |
| parent | 825ea052ad5638c056037c4cac92c9e666dc3820 (diff) | |
| download | emacs-622825995204b7aae70b836c8e5e5d44385c401b.tar.gz emacs-622825995204b7aae70b836c8e5e5d44385c401b.zip | |
Respect point when changing direction after isearch scrolling.
* lisp/isearch.el (isearch-repeat): Don't go to isearch-other-end
on changing direction after scrolling (bug#78074).
| -rw-r--r-- | lisp/isearch.el | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lisp/isearch.el b/lisp/isearch.el index e37d1814eb7..5cde8092bde 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el | |||
| @@ -1950,7 +1950,14 @@ Use `isearch-exit' to quit without signaling." | |||
| 1950 | (funcall isearch-wrap-function) | 1950 | (funcall isearch-wrap-function) |
| 1951 | (goto-char (if isearch-forward (point-min) (point-max)))))) | 1951 | (goto-char (if isearch-forward (point-min) (point-max)))))) |
| 1952 | ;; C-s in reverse or C-r in forward, change direction. | 1952 | ;; C-s in reverse or C-r in forward, change direction. |
| 1953 | (if (and isearch-other-end isearch-repeat-on-direction-change) | 1953 | (if (and isearch-other-end isearch-repeat-on-direction-change |
| 1954 | (or (null isearch-cmds) | ||
| 1955 | ;; Go to 'isearch-other-end' only when point is still | ||
| 1956 | ;; on the current match. However, after scrolling | ||
| 1957 | ;; (when 'isearch-allow-scroll' is 'unlimited'), | ||
| 1958 | ;; repeat the reversed search from a new position | ||
| 1959 | ;; where point was moved during scrolling (bug#78074). | ||
| 1960 | (eq (isearch--state-point (car isearch-cmds)) (point)))) | ||
| 1954 | (goto-char isearch-other-end)) | 1961 | (goto-char isearch-other-end)) |
| 1955 | (setq isearch-forward (not isearch-forward) | 1962 | (setq isearch-forward (not isearch-forward) |
| 1956 | isearch-success t)) | 1963 | isearch-success t)) |