branch: elpa/symbol-overlay
commit ca3b02c99ec3f85b15b9928c3c81a80b381bce22
Author: Steve Purcell <[email protected]>
Commit: Steve Purcell <[email protected]>
When highlighting, check current buffer is the one in selected-window
Just because a timer is triggered for a buffer does not mean that its
window is selected.
---
symbol-overlay.el | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/symbol-overlay.el b/symbol-overlay.el
index 650eab3142..a1fcc3e629 100644
--- a/symbol-overlay.el
+++ b/symbol-overlay.el
@@ -290,7 +290,7 @@ depending on SCOPE and WINDOW."
(and p (setq min (progn (backward-paragraph) (point))
max (progn (forward-paragraph) (point))))
(narrow-to-region min max)))
- (when window
+ (when (and window (eq (window-buffer) (current-buffer)))
(narrow-to-region (window-start) (window-end)))))
(defun symbol-overlay-remove-temp ()
@@ -300,7 +300,7 @@ depending on SCOPE and WINDOW."
(defun symbol-overlay-maybe-put-temp ()
"Highlight symbol at point when there are more than 2 occurrences.
-This only effects symbols in the current displayed window if
+This only affects symbols in the current displayed window if
`symbol-overlay-displayed-window' is non-nil."
(when symbol-overlay-mode
(let* ((case-fold-search nil)