emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] master bda04b2 35/78: Properly highlight depending on avy-all-win


From: Oleh Krehel
Subject: [elpa] master bda04b2 35/78: Properly highlight depending on avy-all-windows
Date: Sat, 23 Jan 2016 13:59:55 +0000

branch: master
commit bda04b287be4636d6f6812432d83164d74160e49
Author: Tassilo Horn <address@hidden>
Commit: Tassilo Horn <address@hidden>

    Properly highlight depending on avy-all-windows
    
    Before this change, the highlighting was only performed in the selected
    window even if avy-all-windows was true.  Now it's consistent with the
    value of that variable.
---
 avy.el |   22 +++++++++++++---------
 1 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/avy.el b/avy.el
index 3fb501e..a030468 100644
--- a/avy.el
+++ b/avy.el
@@ -1075,15 +1075,19 @@ read string immediately instead of waiting for another 
char for
               (setq str (concat str (list char)))))
             ;; Highlight
             (when (>= (length str) 1)
-              (save-excursion
-                (goto-char (window-start))
-                (setq regex (regexp-quote str))
-                (while (re-search-forward regex (window-end) t)
-                  (unless (get-char-property (point) 'invisible)
-                    (let ((ov (make-overlay (match-beginning 0) (match-end 
0))))
-                      (push ov overlays)
-                      (overlay-put ov 'window (selected-window))
-                      (overlay-put ov 'face 'avy-goto-char-timer-face)))))))
+              (dolist (win (if avy-all-windows
+                               (window-list)
+                             (list (selected-window))))
+                (with-selected-window win
+                  (save-excursion
+                    (goto-char (window-start))
+                    (setq regex (regexp-quote str))
+                    (while (re-search-forward regex (window-end) t)
+                      (unless (get-char-property (point) 'invisible)
+                        (let ((ov (make-overlay (match-beginning 0) (match-end 
0))))
+                          (push ov overlays)
+                          (overlay-put ov 'window (selected-window))
+                          (overlay-put ov 'face 
'avy-goto-char-timer-face)))))))))
           str)
       (dolist (ov overlays)
         (delete-overlay ov)))))



reply via email to

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