diff options
| -rw-r--r-- | lisp/magit-base.el | 3 | ||||
| -rw-r--r-- | lisp/magit-diff.el | 21 |
2 files changed, 15 insertions, 9 deletions
diff --git a/lisp/magit-base.el b/lisp/magit-base.el index cdb8e20..53916cf 100644 --- a/lisp/magit-base.el +++ b/lisp/magit-base.el @@ -504,6 +504,9 @@ and delay of your graphical environment or operating system." (heading-highlight-face :initform 'magit-diff-hunk-heading-highlight) (heading-selection-face :initform 'magit-diff-hunk-heading-selection))) +(defun magit--meta-hunk-p (section) + (not (cdr (oref section value)))) + (setf (alist-get 'file magit--section-type-alist) 'magit-file-section) (setf (alist-get 'module magit--section-type-alist) 'magit-module-section) (setf (alist-get 'hunk magit--section-type-alist) 'magit-hunk-section) diff --git a/lisp/magit-diff.el b/lisp/magit-diff.el index 4ccc51b..6caeeec 100644 --- a/lisp/magit-diff.el +++ b/lisp/magit-diff.el @@ -3683,10 +3683,11 @@ actually a `diff' but a `diffstat' section." (magit--add-face-text-property bol (+ bol (if merging 2 1)) sign-face))) (forward-line))) - (when (eq magit-diff-fontify-hunk 'all) - (magit-diff--update-hunk-syntax section)) - (when (eq magit-diff-refine-hunk 'all) - (magit-diff-update-hunk-refinement section)) + (unless (magit--meta-hunk-p section) + (when (eq magit-diff-fontify-hunk 'all) + (magit-diff--update-hunk-syntax section)) + (when (eq magit-diff-refine-hunk 'all) + (magit-diff-update-hunk-refinement section))) (oset section painted (if highlight 'highlight 'plain))) ;;;; Whitespace @@ -3760,10 +3761,11 @@ actually a `diff' but a `diffstat' section." ;;;; Refinement (cl-defmethod magit-section--refine ((section magit-hunk-section)) - (when (eq magit-diff-fontify-hunk t) - (magit-diff--update-hunk-syntax section)) - (when (eq magit-diff-refine-hunk t) - (magit-diff-update-hunk-refinement section))) + (unless (magit--meta-hunk-p section) + (when (eq magit-diff-fontify-hunk t) + (magit-diff--update-hunk-syntax section)) + (when (eq magit-diff-refine-hunk t) + (magit-diff-update-hunk-refinement section)))) (defun magit-diff-update-hunk-refinement (&optional section allow-remove) (if section @@ -3820,7 +3822,8 @@ actually a `diff' but a `diffstat' section." (forward-line 1)))))) (named-let update ((section magit-root-section)) (if (magit-section-match 'hunk section) - (magit-diff--update-hunk-syntax section) + (unless (magit--meta-hunk-p section) + (magit-diff--update-hunk-syntax section)) (dolist (child (oref section children)) (update child)))))) |
