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:
parent
5c3ac91e0f
commit
63e78891d8
1 changed files with 7 additions and 4 deletions
11
magit.el
11
magit.el
|
@ -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)
|
||||||
|
|
Loading…
Add table
Reference in a new issue