Add command magit-toggle-file-section.
For those who never want to toggle at hunk granularity.
This commit is contained in:
parent
94ca78a86f
commit
8020b0396a
1 changed files with 7 additions and 0 deletions
7
magit.el
7
magit.el
|
@ -881,6 +881,13 @@ Many Magit faces inherit from this one by default."
|
|||
(interactive)
|
||||
(magit-section-hideshow #'magit-section-expand))
|
||||
|
||||
(defun magit-toggle-file-section ()
|
||||
"Like `magit-toggle-section' but toggles at file granularity."
|
||||
(interactive)
|
||||
(when (eq 'hunk (first (magit-section-context-type (magit-current-section))))
|
||||
(magit-goto-parent-section))
|
||||
(magit-toggle-section))
|
||||
|
||||
(defun magit-toggle-section ()
|
||||
(interactive)
|
||||
(magit-section-hideshow
|
||||
|
|
Loading…
Reference in a new issue