aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2014-11-24 15:32:14 +0200
committerEli Zaretskii2014-11-24 15:32:14 +0200
commit9faf591a66aa0c5ab4522f2077c170b79e95c9ec (patch)
tree2b8f7a881adb948b594c568c52c533f57cae5717
parente01ec2ed084776b370e0634120deec6b65424b8a (diff)
downloademacs-9faf591a66aa0c5ab4522f2077c170b79e95c9ec.tar.gz
emacs-9faf591a66aa0c5ab4522f2077c170b79e95c9ec.zip
Fix bug #19157 with incorrect hscroll during I-search.
lisp/isearch.el (isearch-update): Don't assume pos-visible-in-window-p will return nil when point is hscrolled out of view.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/isearch.el13
2 files changed, 16 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c3a01dac664..26376afe239 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12014-11-24 Eli Zaretskii <eliz@gnu.org>
2
3 * isearch.el (isearch-update): Don't assume
4 pos-visible-in-window-p will return nil when point is hscrolled
5 out of view. (Bug#19157)
6
12014-11-20 Andrey Kotlarski <m00naticus@gmail.com> 72014-11-20 Andrey Kotlarski <m00naticus@gmail.com>
2 8
3 * net/eww.el (eww-browse-url): Optionally create new eww buffer. 9 * net/eww.el (eww-browse-url): Optionally create new eww buffer.
diff --git a/lisp/isearch.el b/lisp/isearch.el
index f0ce7050e78..c3e473a2ba6 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -974,10 +974,17 @@ The last thing it does is to run `isearch-update-post-hook'."
974 (other-window 1)) 974 (other-window 1))
975 (goto-char found-point)) 975 (goto-char found-point))
976 ;; Keep same hscrolling as at the start of the search when possible 976 ;; Keep same hscrolling as at the start of the search when possible
977 (let ((current-scroll (window-hscroll))) 977 (let ((current-scroll (window-hscroll))
978 visible-p)
978 (set-window-hscroll (selected-window) isearch-start-hscroll) 979 (set-window-hscroll (selected-window) isearch-start-hscroll)
979 (unless (pos-visible-in-window-p) 980 (setq visible-p (pos-visible-in-window-p nil nil t))
980 (set-window-hscroll (selected-window) current-scroll)))) 981 (if (or (not visible-p)
982 ;; When point is not visible because of hscroll,
983 ;; pos-visible-in-window-p returns non-nil, but
984 ;; the X coordinate it returns is 1 pixel beyond
985 ;; the last visible one.
986 (>= (car visible-p) (window-body-width nil t)))
987 (set-window-hscroll (selected-window) current-scroll))))
981 (if isearch-other-end 988 (if isearch-other-end
982 (if (< isearch-other-end (point)) ; isearch-forward? 989 (if (< isearch-other-end (point)) ; isearch-forward?
983 (isearch-highlight isearch-other-end (point)) 990 (isearch-highlight isearch-other-end (point))