evil-mode
有evil-emacs-state-modes
var,用于定义要在emacs
模式下打开的模式。
我在该var中列出了magit-diff-mode
(实际上,它是默认值)。
在magit-diff
模式下正常运行emacs
。
但是,如果我运行magit-status
(在emacs mode
中打开),请将该点放在Head
(缓冲区中的第一行)并点击 Ret ,magit-visit-thing
被调用,并且提交信息显示在新缓冲区中。此缓冲区位于magit-diff-mode
中,但evil-mode
对此缓冲区有效。
如何防止此行为?
答案 0 :(得分:0)
As we figured out in the comments - the buffer opens in magit-revision-mode
, not in magit-diff-mode
.
To find out the major mode of the buffer, describe variable major-mode
- C-h v major-mode <RET>
.
For you information, when you do describe-mode
instead (C-h m
) what you see as mode name is the string that appears in the status line. It may be difficult to guess from it what the actual mode name is - like Magit Rev
is actually a string for magit-revision-mode
- no way of knowing unless you look in magit-diff.el
:
define-derived-mode magit-revision-mode magit-diff-mode "Magit Rev"