Only try to fit current section into window when it is not hidden.

* magit.el (magit-goto-next-section): Here.
This commit is contained in:
Marius Vollmer 2009-03-01 03:02:19 +02:00
parent 5c3ac91e0f
commit 63e78891d8

View file

@ -606,10 +606,13 @@ Many Magit faces inherit from this one by default."
(goto-char (magit-section-beginning next)) (goto-char (magit-section-beginning next))
(if (memq magit-submode '(log reflog)) (if (memq magit-submode '(log reflog))
(magit-show-commit next)) (magit-show-commit next))
(let ((offset (- (line-number-at-pos (magit-section-beginning next)) (if (not (magit-section-hidden next))
(line-number-at-pos (magit-section-end next))))) (let ((offset (- (line-number-at-pos
(if (< offset (window-height)) (magit-section-beginning next))
(recenter offset)))) (line-number-at-pos
(magit-section-end next)))))
(if (< offset (window-height))
(recenter offset)))))
(message "No next section")))) (message "No next section"))))
(defun magit-prev-section (section) (defun magit-prev-section (section)