You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Visual block operation shall end by turning into normal mode #803
Thanks for the precise steps, and for checking #792 so soon after it shipped. Your sequence reproduced it first try.
Reproduced on 2.51.1 in the built desktop app: Ctrl-v, j, j, I, - , Esc put the text on every row and left the editor in insert mode, with typing still going into the note. Ctrl-[ ended the same edit in normal mode correctly, which pointed at the Escape key itself rather than at the block edit.
Cause. The editor's keymaps get every key before the Vim layer does, and two of them were spending Escape:
CodeMirror's default keymap uses Escape to collapse multiple cursors. Visual rectangular block edits not working as in vim #792 made block edits real multi-cursors, so from that release on Escape collapsed the cursors, reported the key as handled, and Vim never heard it.
The autocomplete keymap takes Escape while a completion is pending, and every typed character counts as pending for about 100ms even when no popup ever appears. So an Escape pressed right after the last character was lost too. That one affected ordinary single-cursor inserts as well, and would have kept block edits stuck for fast typists even with the first part fixed.
What changes for you
A block I, A or c followed by Esc ends in normal mode with a single cursor. u then undoes the whole block edit in one step.
After v or V, Esc leaves the cursor where Vim puts it (on the last selected character) instead of one position off.
Esc pressed immediately after typing is never swallowed. Handy with Escape on Caps Lock.
Unchanged: with a completion popup actually on screen, the first Esc still closes the popup and keeps you in insert mode.
Verified in the built app over real key events across 15 scenarios, all matching Vim. The earlier #792 tests claimed "returns to normal mode" and passed, because the test harness mounted Vim ahead of the keymaps, the reverse of the real editor. That is fixed too, and the new tests fail without this change.
Status. Committed as 81798b43 on the v2.52.0 branch. It ships in 2.52.0, which is not released yet.
Closing since the fix is in. If 2.52.0 still leaves you in insert mode after a block edit, comment here and I'll reopen.
Activity
adibhanna commentedon Sep 17, 2026
Thanks for the precise steps, and for checking #792 so soon after it shipped. Your sequence reproduced it first try.
Reproduced on 2.51.1 in the built desktop app:
Ctrl-v,j,j,I,-,Escput the text on every row and left the editor in insert mode, with typing still going into the note.Ctrl-[ended the same edit in normal mode correctly, which pointed at the Escape key itself rather than at the block edit.Cause. The editor's keymaps get every key before the Vim layer does, and two of them were spending Escape:
What changes for you
I,Aorcfollowed byEscends in normal mode with a single cursor.uthen undoes the whole block edit in one step.Ctrl-v...Esc) takes one press. It needed two since Visual rectangular block edits not working as in vim #792, for the same reason.vorV,Escleaves the cursor where Vim puts it (on the last selected character) instead of one position off.Escpressed immediately after typing is never swallowed. Handy with Escape on Caps Lock.Escstill closes the popup and keeps you in insert mode.Verified in the built app over real key events across 15 scenarios, all matching Vim. The earlier #792 tests claimed "returns to normal mode" and passed, because the test harness mounted Vim ahead of the keymaps, the reverse of the real editor. That is fixed too, and the new tests fail without this change.
Status. Committed as 81798b43 on the
v2.52.0branch. It ships in 2.52.0, which is not released yet.Closing since the fix is in. If 2.52.0 still leaves you in insert mode after a block edit, comment here and I'll reopen.
Fix(vim): Escape ends a block edit in normal mode