Better handling of hidden sections with 'n' and 'p'.

* magit.el (magit-goto-next-section, magit-prev-section): Don't
descend into hidden sections.
This commit is contained in:
Marius Vollmer 2008-09-08 23:19:12 +03:00
parent 246eb467b7
commit 2bf9c19866

View file

@ -435,7 +435,8 @@ Many Magit faces inherit from this one by default."
(defun magit-goto-next-section ()
(interactive)
(let* ((section (magit-current-section))
(next (or (and (magit-section-children section)
(next (or (and (not (magit-section-hidden section))
(magit-section-children section)
(magit-find-section-after (point)
(magit-section-children
section)))
@ -450,7 +451,8 @@ Many Magit faces inherit from this one by default."
(let ((prev (cadr (memq section
(reverse (magit-section-children parent))))))
(cond (prev
(while (magit-section-children prev)
(while (and (not (magit-section-hidden prev))
(magit-section-children prev))
(setq prev (car (reverse (magit-section-children prev)))))
prev)
(t