]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix Isearch hscrolling in a corner case
authorEli Zaretskii <eliz@gnu.org>
Thu, 22 Apr 2021 11:01:42 +0000 (14:01 +0300)
committerEli Zaretskii <eliz@gnu.org>
Thu, 22 Apr 2021 11:01:42 +0000 (14:01 +0300)
* lisp/isearch.el (isearch-update): When we start hscrolled,
consider also the case that point ends up being to the left of the
hscrolled window's edge.  (Bug#46316)

lisp/isearch.el

index f1c61fc167743abd8eef186c4eccf8b5c1d58e75..9f3cfd70fb3e32b6e4fca752e20e90e48b788fb5 100644 (file)
@@ -1374,7 +1374,8 @@ The last thing is to trigger a new round of lazy highlighting."
                    ;; the X coordinate it returns is 1 pixel beyond
                    ;; the last visible one.
                    (>= (car visible-p)
-                        (* (window-max-chars-per-line) (frame-char-width))))
+                        (* (window-max-chars-per-line) (frame-char-width)))
+                    (< (car visible-p) 0))
                (set-window-hscroll (selected-window) current-scroll))))
        (if isearch-other-end
             (if (< isearch-other-end (point)) ; isearch-forward?