magit-goto-next-section: when moving down to the next section, try to fit the

whole hunk in the window
This commit is contained in:
David Wallin 2009-02-19 03:17:40 +00:00 committed by Marius Vollmer
parent 043c90e740
commit 3efeed124e

View file

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