]> git.eshelyaron.com Git - emacs.git/commitdiff
Lazy-highlight the whole string at point
authorJuri Linkov <juri@linkov.net>
Mon, 15 Dec 2014 23:45:12 +0000 (01:45 +0200)
committerJuri Linkov <juri@linkov.net>
Mon, 15 Dec 2014 23:45:12 +0000 (01:45 +0200)
* 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
lisp/isearch.el

index 364511c2c15f89d2028c917d47f41a1118178f3a..5a0a62fef683199ed7abd25dbb037038e88e30f3 100644 (file)
@@ -1,3 +1,9 @@
+2014-12-15  Juri Linkov  <juri@linkov.net>
+
+       * 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  <larsi@gnus.org>
 
        * net/shr.el (shr-fold-text): Don't bug out on zero-length text.
index ef0c4a78b89159128a3b24f13c9d46556fdb096e..fde93530cc081fdce625319d918a3e8d4806ed58 100644 (file)
@@ -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