GNU bug report logs - #19353
25.0.50; Lazy Highlighting

Previous Next

Package: emacs;

Reported by: Dani Moncayo <dmoncayo <at> gmail.com>

Date: Thu, 11 Dec 2014 21:13:02 UTC

Severity: minor

Found in version 25.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 19353 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Dani Moncayo <dmoncayo <at> gmail.com>
Cc: 19353 <at> debbugs.gnu.org
Subject: Re: bug#19353: 25.0.50; Lazy Highlighting
Date: Fri, 12 Dec 2014 02:18:10 +0200
> 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




This bug report was last modified 10 years and 162 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.