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:
parent
043c90e740
commit
3efeed124e
1 changed files with 6 additions and 1 deletions
7
magit.el
7
magit.el
|
@ -579,11 +579,16 @@ Many Magit faces inherit from this one by default."
|
||||||
(magit-section-children
|
(magit-section-children
|
||||||
section)))
|
section)))
|
||||||
(magit-next-section section))))
|
(magit-next-section section))))
|
||||||
|
|
||||||
(if next
|
(if next
|
||||||
(progn
|
(progn
|
||||||
(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))
|
||||||
|
(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)
|
||||||
|
|
Loading…
Reference in a new issue