bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#19353: 25.0.50; Lazy Highlighting


From: Juri Linkov
Subject: bug#19353: 25.0.50; Lazy Highlighting
Date: Fri, 12 Dec 2014 02:18:10 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (x86_64-pc-linux-gnu)

> Recipe:
> 0. emacs -Q
> 1. Create and empty buffer.
> 2. Write there this text (without the hyphen lines):
> --------------
> fat cat path
> too book cool
> --------------
> 3. Place point just after the "a" in "path".
> 4. Type: C-s a t

> 5. Place point just after the first "o" in "cool".
> 6. Type: C-s o o

Does this patch address all your test cases?  It prolongs the
boundary of the wrapped search by the length of the search string,
and in the worst case it might lazy-highlight some matches twice.

diff --git a/lisp/isearch.el b/lisp/isearch.el
index c3e473a..5fb687b 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -3063,11 +3063,13 @@ (defun isearch-lazy-highlight-search ()
            (bound (if isearch-lazy-highlight-forward
                       (min (or isearch-lazy-highlight-end-limit (point-max))
                            (if isearch-lazy-highlight-wrapped
-                               isearch-lazy-highlight-start
+                               (+ isearch-lazy-highlight-start
+                                  (1- (length 
isearch-lazy-highlight-last-string)))
                              (window-end)))
                     (max (or isearch-lazy-highlight-start-limit (point-min))
                          (if isearch-lazy-highlight-wrapped
-                             isearch-lazy-highlight-end
+                             (- isearch-lazy-highlight-end
+                                (1- (length 
isearch-lazy-highlight-last-string)))
                            (window-start))))))
        ;; Use a loop like in `isearch-search'.
        (while retry





reply via email to

[Prev in Thread] Current Thread [Next in Thread]