Emacs magit diff-buffer 滚动 - 如何在底部停止

Emacs magit diff-buffer scrolling - how to stop at bottom

想知道是否有人知道magit 中控制滚动的参数。目前,当我在 magit-log 缓冲区中并继续按下 space 键时,另一个 window 中的差异视图滚动到底部,并且继续回到顶部并滚动 - 有效无休止。有没有办法让它停在底部?

没有选项,但你可以重新定义你想要的行为 magit-diff-show-or-scroll-up:

(defun magit-diff-show-or-scroll-up ()
  "Update the commit or diff buffer for the thing at point.

Either show the commit or stash at point in the appropriate
buffer, or if that buffer is already being displayed in the
current frame and contains information about that commit or
stash, then instead scroll the buffer up.  If there is no
commit or stash at point, then prompt for a commit."
  (interactive)
  (magit-diff-show-or-scroll (lambda () (scroll-up))))