Function: magit-section-hide
magit-section-hide is an interactive and byte-compiled function
defined in magit-section.el.
Signature
(magit-section-hide SECTION)
Documentation
Hide the body of the current section.
Key Bindings
Source Code
;; Defined in ~/.emacs.d/elpa/magit-section-20260330.1102/magit-section.el
(defun magit-section-hide (section)
"Hide the body of the current section."
(interactive (list (magit-current-section)))
(if (eq section magit-root-section)
(user-error "Cannot hide root section")
(oset section hidden t)
(when-let ((beg (oref section content)))
(let ((end (oref section end)))
(when (< beg (point) end)
(goto-char (oref section start)))
(remove-overlays beg end 'invisible t)
(let ((o (make-overlay beg end)))
(overlay-put o 'evaporate t)
(overlay-put o 'invisible t)
(overlay-put o 'cursor-intangible t))))
(magit-section-maybe-update-visibility-indicator section)
(magit-section-maybe-cache-visibility section)))