Emacs - evil-mode 导致 eldoc-mode 闪烁

3
任何移动命令都会导致 minibuffer 中的 eldoc-message 闪烁。禁用 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时防止闪烁?
1个回答

2
所以,evil-mode 是无辜的。罪魁祸首是 key-chord.el
当按下在 `key-chord-define` 中定义的按键时,显示器会闪烁。我将 "jk" 绑定到了 `keyboard-quit`,因此每次我按下 `j` 或 `k`,eldoc 就会闪烁。
(key-chord-define-global "jk" 'keyboard-quit)

这不是 evil-mode 中的 bug。只是在 evil-mode 中更加明显,因为有像 hj 这样的单字母命令。
我在 https://github.com/jschaf/key-chord 上修补了 key-chord 以解决闪烁问题。请参见 commit a2f6c61 获取实际的修复方案。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接