branch: master
commit bda04b287be4636d6f6812432d83164d74160e49
Author: Tassilo Horn <[email protected]>
Commit: Tassilo Horn <[email protected]>
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)))))