]> git.eshelyaron.com Git - emacs.git/commitdiff
Ignore `highlight-nonselected-windows' for same buffer in two windows
authorOleh Krehel <ohwoeowho@gmail.com>
Tue, 31 Mar 2015 11:42:04 +0000 (13:42 +0200)
committerOleh Krehel <ohwoeowho@gmail.com>
Tue, 31 Mar 2015 11:42:04 +0000 (13:42 +0200)
* lisp/simple.el (redisplay--update-region-highlights): Update.

It looks really weird when the same buffer is opened in multiple
windows and `highlight-nonselected-windows' is t. Especially when the
mouse is pressed.

lisp/simple.el

index 518560704374b16ad0ffa561e936ebde83645a29..ce6e24e7cba9f300d2346968406308c9ba997887 100644 (file)
@@ -4955,7 +4955,13 @@ also checks the value of `use-empty-active-region'."
         (redisplay--update-region-highlight (selected-window))
       (unless (listp windows) (setq windows (window-list-1 nil nil t)))
       (if highlight-nonselected-windows
-          (mapc #'redisplay--update-region-highlight windows)
+          (mapc #'redisplay--update-region-highlight
+                (delq nil
+                      (mapcar (lambda (w)
+                                (unless (eq (window-buffer w)
+                                            (current-buffer))
+                                  w))
+                              windows)))
         (let ((msw (and (window-minibuffer-p) (minibuffer-selected-window))))
           (dolist (w windows)
             (if (or (eq w (selected-window)) (eq w msw))