From 8020b0396a9e6d0883385f1ef6e99df7b34cb704 Mon Sep 17 00:00:00 2001 From: Hannu Koivisto Date: Sat, 24 Oct 2009 03:33:26 +0300 Subject: [PATCH] Add command magit-toggle-file-section. For those who never want to toggle at hunk granularity. --- magit.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/magit.el b/magit.el index cc202e5d..2bc69548 100644 --- a/magit.el +++ b/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