[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/git-commit 16fdf49 2/4: magit-diff-update-hunk-region: Add
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/git-commit 16fdf49 2/4: magit-diff-update-hunk-region: Add performance tweak |
Date: |
Sun, 29 Aug 2021 15:57:30 -0400 (EDT) |
branch: elpa/git-commit
commit 16fdf498367a384ab51078dd771531bcde92f993
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
magit-diff-update-hunk-region: Add performance tweak
This is run very often so we want to abort as quickly as possible.
---
lisp/magit-diff.el | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lisp/magit-diff.el b/lisp/magit-diff.el
index b8bf5fe..067caba 100644
--- a/lisp/magit-diff.el
+++ b/lisp/magit-diff.el
@@ -3229,7 +3229,8 @@ are highlighted."
(defun magit-diff-update-hunk-region (section)
"Highlight the hunk-internal region if any."
- (when (eq (magit-diff-scope section t) 'region)
+ (when (and (eq (oref section type) 'hunk)
+ (eq (magit-diff-scope section t) 'region))
(magit-diff--make-hunk-overlay
(oref section start)
(1- (oref section content))