emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/git-commit cd2b712602 2/2: magit-diff-highlight-file: Alwa


From: ELPA Syncer
Subject: [nongnu] elpa/git-commit cd2b712602 2/2: magit-diff-highlight-file: Always highlight module sections
Date: Wed, 23 Feb 2022 15:58:16 -0500 (EST)

branch: elpa/git-commit
commit cd2b712602ab4ae6bc930d9e9011c5f669562117
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    magit-diff-highlight-file: Always highlight module sections
    
    Module sections are currently being treated as a special kind of file
    sections, which may be a mistake, but determining that will require
    additional research.  This commit fixes one issue that resulted from
    this mismatch.
    
    Unlike regular file sections, the children of modules are commits not
    hunks, but the specialized code that delays highlighting diff-related
    sections does not deal with commits.  For module sections the
    highlighting was delayed, but then not performed at a later time.
    
    Now we don't delay it anymore, which for these sections isn't
    necessary anyway because doing it is as cheap as it is for other
    non-diff sections, which also do not delay highlighting of children
    that are hidden because the parent is collapsed.
---
 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 1306c4f270..4d5e43c133 100644
--- a/lisp/magit-diff.el
+++ b/lisp/magit-diff.el
@@ -3021,7 +3021,8 @@ are highlighted."
 
 (defun magit-diff-highlight-file (section &optional selection)
   (magit-diff-highlight-heading section selection)
-  (unless (oref section hidden)
+  (when (or (not (oref section hidden))
+            (cl-typep section 'magit-module-section))
     (dolist (child (oref section children))
       (magit-diff-highlight-recursive child selection))))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]