GNU bug report logs -
#33838
27.0.50; lazy-highlight fails with a quick key sequence
Previous Next
Reported by: Juri Linkov <juri <at> linkov.net>
Date: Sun, 23 Dec 2018 00:08:01 UTC
Severity: normal
Found in version 27.0.50
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
Full log
Message #8 received at 33838 <at> debbugs.gnu.org (full text, mbox):
> Quickly typing `C-s C-s' to repeat the last search in a file with long
> wrapped lines sometimes fails to lazy-highlight other matches.
>
> This is because the condition in isearch-lazy-highlight-new-loop relies on
> the return value of `(sit-for 0)' and when there is input pending like the
> second `C-s' keystroke unprocessed due to the large file size with long
> lines, it doesn't start a new lazy-highlight loop.
I realized that sit-for here is for a reason to not try running
isearch-lazy-highlight-new-loop on every keypress. The problem is that
when the first `C-s' is ignored (in this case isearch-string is an empty
string and isearch-lazy-highlight-last-string is the last search string),
for the second `C-s', isearch-string is equal to isearch-lazy-highlight-last-string
from the last search, so a new loop is not initiated.
A proper fix would be to reset isearch-lazy-highlight-last-string
on exiting Isearch, so it won't affect the next search:
diff --git a/lisp/isearch.el b/lisp/isearch.el
index dd0973d4ea..d2c1c150b5 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -1357,6 +1357,7 @@ isearch-done
(setq minibuffer-message-timeout isearch-original-minibuffer-message-timeout)
(isearch-dehighlight)
(lazy-highlight-cleanup lazy-highlight-cleanup)
+ (setq isearch-lazy-highlight-last-string nil)
(let ((found-start (window-group-start))
(found-point (point)))
(when isearch-window-configuration
This bug report was last modified 6 years and 204 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.