vundo icon indicating copy to clipboard operation
vundo copied to clipboard

cursor hiding doesn't work with evil-mode

Open Dickby opened this issue 2 years ago • 3 comments

evil-mode prevents that cursor hiding in the vundo-undo-tree buffer somehow.

Dickby avatar Jun 12 '22 09:06 Dickby

I found that this is a well known problem with evil-mode. Other packages are trying to work around that issue: https://github.com/alexluigit/dirvish/issues/43 https://github.com/jaypei/emacs-neotree/issues/233

but really it should be resolved in evil itself. here is the open issue https://github.com/emacs-evil/evil/issues/592 .

The hack mentioned in that issue works for vundo too: (setq-local evil-normal-state-cursor '(bar . 0)) maybe this could be added to vundo until that evil cursor problem is solved (if it ever will be).

Thanks

Dickby avatar Jun 13 '22 10:06 Dickby

I solved this problem by adding ("^ \\*vundo tree\\*" . nil) to evil-buffer-regexps, so evil will completely ignore vundo's buffer.

geza-herman avatar Mar 13 '24 09:03 geza-herman

I solved this problem by adding ("^ \\*vundo tree\\*" . nil) to evil-buffer-regexps, so evil will completely ignore vundo's buffer.

This hack avoids the problem, but also misses the evil feature (such as leader key, or evil key binding).

The hack mentioned in that issue works for vundo too: (setq-local evil-normal-state-cursor '(bar . 0)) maybe this could be added to vundo until that evil cursor problem is solved (if it ever will be).

I found this hack performs differently in Emacs Mac Port and Emacs Plus. In Emacs Mac Port, this hack work as expect, while in Emacs Plus, still a narrow bar lefts (It seems like Emacs Plus treat 'zero' width bar as a very narrow bar, not just nothing).

Actually, (setq-local cursor-type nil) means don't display a cursor, BUT somehow evil refreshes this variable, and don't supports just (setq-local evil-normal-state-cursor nil).

Fortunately, we can also set evil-normal-state-cursor as a "zero-argument function", So I try this hack:

(setq-local evil-normal-state-cursor '(lambda () (setq-local cursor-type nil)))

and now, it works perfectlly in both Emacs Mac Port and Emacs Plus! :-)

DeesonGao avatar May 15 '24 15:05 DeesonGao