任何移动命令都会导致迷你缓冲区中的 eldoc 消息闪烁。禁用 evil-mode 会消除闪烁。
从 eldoc 文档中,我找到了这个相关片段。
;; This function goes on pre-command-hook for XEmacs or when using idle
;; timers in Emacs. Motion commands clear the echo area for some reason,
;; which make eldoc messages flicker or disappear just before motion
;; begins. This function reprints the last eldoc message immediately
;; before the next command executes, which does away with the flicker.
;; This doesn't seem to be required for Emacs 19.28 and earlier.
(defun eldoc-pre-command-refresh-echo-area ()
(and eldoc-last-message
(if (eldoc-display-message-no-interference-p)
(eldoc-message eldoc-last-message)
(setq eldoc-last-message nil))))
如何在启用 evil-mode 的情况下防止闪烁?
最佳答案
所以, evil-mode 是无辜的。罪魁祸首是key-chord.el .
当按下 key-chord-define
中存在的键时,显示屏会闪烁。我将“jk”绑定(bind)到 keyboard-quit
,所以每次我按下 j
或 k
时,eldoc 都会闪烁。
(key-chord-define-global "jk" 'keyboard-quit)
这不是 evil-mode 中的错误。由于 h
和 j
等单字母命令,它在 evil-mode 下更加明显。
我在 https://github.com/jschaf/key-chord 修补了键和弦修复闪烁。参见 commit a2f6c61进行实际修复。
关于Emacs - evil-mode 导致 eldoc 模式闪烁,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25829232/