branch: elpa/magit
commit 58cc6d6c9b0ecf19096b2ce1185f434d9f68d4d1
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>
magit-section-hidden: New function
---
lisp/magit-section.el | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/lisp/magit-section.el b/lisp/magit-section.el
index 9410d861d7c..ea98d612cfe 100644
--- a/lisp/magit-section.el
+++ b/lisp/magit-section.el
@@ -1053,7 +1053,14 @@ global map, this involves advising
`tab-bar--define-keys'."
(t
(mapc #'magit-section-hide children)))))
+(defun magit-section-hidden (section)
+ "Return t if SECTION and/or an ancestor is hidden."
+ (or (oref section hidden)
+ (and-let* ((parent (oref section parent)))
+ (magit-section-hidden parent))))
+
(defun magit-section-hidden-body (section &optional pred)
+ "Return t if the content of SECTION or of any children is hidden."
(if-let ((children (oref section children)))
(funcall (or pred #'seq-some) #'magit-section-hidden-body children)
(and (oref section content)