emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 10ec046: Lazy-highlight the whole string at point


From: Juri Linkov
Subject: [Emacs-diffs] master 10ec046: Lazy-highlight the whole string at point
Date: Mon, 15 Dec 2014 23:45:19 +0000

branch: master
commit 10ec0468dfbc0815a772cc46a031aca298af0985
Author: Juri Linkov <address@hidden>
Commit: Juri Linkov <address@hidden>

    Lazy-highlight the whole string at point
    
    * lisp/isearch.el (isearch-lazy-highlight-search): Extend the bound of
    the wrapped search by the length of the search string to be able
    to lazy-highlight the whole search string at point.
    
    Fixes: debbugs:19353
---
 lisp/ChangeLog  |    6 ++++++
 lisp/isearch.el |    8 ++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 364511c..5a0a62f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
+2014-12-15  Juri Linkov  <address@hidden>
+
+       * isearch.el (isearch-lazy-highlight-search): Extend the bound of
+       the wrapped search by the length of the search string to be able
+       to lazy-highlight the whole search string at point (bug#19353).
+
 2014-12-15  Lars Magne Ingebrigtsen  <address@hidden>
 
        * net/shr.el (shr-fold-text): Don't bug out on zero-length text.
diff --git a/lisp/isearch.el b/lisp/isearch.el
index ef0c4a7..fde9353 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -3063,11 +3063,15 @@ Attempt to do the search exactly the way the pending 
Isearch would."
            (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
+                                  ;; Extend bound to match whole string at 
point
+                                  (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
+                                ;; Extend bound to match whole string at point
+                                (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]