[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/git-commit 65560b1566 1/2: Avoid highlighting twice when r
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/git-commit 65560b1566 1/2: Avoid highlighting twice when refreshing |
Date: |
Tue, 8 Mar 2022 13:58:13 -0500 (EST) |
branch: elpa/git-commit
commit 65560b156641068ecb466f9d719c6c3cb2fac5c9
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
Avoid highlighting twice when refreshing
`magit-refresh' and `magit-refresh-all' update highlighting
explicitly because they might have to do it in multiple buffers.
---
lisp/magit-section.el | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lisp/magit-section.el b/lisp/magit-section.el
index 01c498a451..fcaae1d979 100644
--- a/lisp/magit-section.el
+++ b/lisp/magit-section.el
@@ -366,7 +366,7 @@ Magit-Section is documented in info node `(magit-section)'."
(make-local-variable 'text-property-default-nonsticky)
(push (cons 'keymap t) text-property-default-nonsticky)
(add-hook 'pre-command-hook #'magit-section-pre-command-hook nil t)
- (add-hook 'post-command-hook #'magit-section-update-highlight t t)
+ (add-hook 'post-command-hook #'magit-section-post-command-hook t t)
(add-hook 'deactivate-mark-hook #'magit-section-deactivate-mark t t)
(setq-local redisplay-highlight-region-function
'magit-section--highlight-region)
@@ -1262,6 +1262,10 @@ evaluated its BODY. Admittedly that's a bit of a hack."
(setq magit-section-pre-command-region-p (region-active-p))
(setq magit-section-pre-command-section (magit-current-section)))
+(defun magit-section-post-command-hook ()
+ (unless (memq this-command '(magit-refresh magit-refresh-all))
+ (magit-section-update-highlight)))
+
(defun magit-section-deactivate-mark ()
(setq magit-section-highlight-force-update t))