branch: elpa/git-commit
commit 16fdf498367a384ab51078dd771531bcde92f993
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>
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))