evil icon indicating copy to clipboard operation
evil copied to clipboard

Cursor does not update when switching from normal to insert state via `i`

Open zane opened this issue 3 years ago • 7 comments

Issue type

  • Bug report

Environment

Emacs version: GNU Emacs 27.1 (build 1, x86_64-apple-darwin20.2.0, NS appkit-2022.20 Version 11.1 (Build 20C69)) of 2021-02-01 Operating System: MacOS Big Sur (11.1) Evil version: 1.14.0 Evil installation type: Straight Graphical/Terminal: Graphical Tested in a make emacs session (see CONTRIBUTING.md): Yes

Reproduction steps

  • make emacs
  • M-x blink-cursor-mode
  • Enter normal state
  • Press i to enter insert state

Expected behavior

Box cursor disappears. Line cursor appears.

Actual behavior

Line cursor appears, but box cursor does not disappear. This gives the appearance that normal state is still active.

Further notes

  • The box cursor disappears either when characters are entered in insert state or when the cursor moves.
  • Forcing redisplay with(add-hook 'evil-insert-state-entry-hook #'redisplay) resolves the issue.

zane avatar Feb 01 '21 09:02 zane

Great bug report. I experienced this regression when recently updating from Emacs 26 to 27.2. I have this in my init.el:

(blink-cursor-mode -1)

The redisplay hook that @zane mentions successfully works around this (thanks @zane!).

Evil package version 20210522.2320

philc avatar May 26 '21 21:05 philc

I can't replicate this in a make emacs session in Emacs 28.0.50. Is this bug specific to Emacs 27 or am I missing something?

tomdl89 avatar Jun 10 '21 17:06 tomdl89

It may well be; I haven't tried replicating it with 28.

zane avatar Jun 10 '21 19:06 zane

I also can't replicate this in 27.1 Anything else I could be missing?

tomdl89 avatar Jun 10 '21 20:06 tomdl89

Might only occur on MacOS, or on this particular build of Emacs?

zane avatar Jun 11 '21 06:06 zane

Here's what it looks like:

https://user-images.githubusercontent.com/26162/121638549-2bc28300-ca59-11eb-87ef-063a49eafe07.mov

Notice how after entering insert mode with the cursor on the 'o' both the normal mode cursor and the insert mode cursor are displayed. The insert mode cursor is hiding the leftmost pixels of the 'o' character.

zane avatar Jun 11 '21 06:06 zane

I'm using Emacs Plus, though I think I could reproduce using Emacs Mac Port as well.

zane avatar Jun 11 '21 06:06 zane