[vim/vim] ESC not leaving insert mode after insert-mode + CTRL-o + operator mapping (Issue #18567)

19 views
Skip to first unread message

Pierre Ganty

unread,
Oct 13, 2025, 12:36:40 PMOct 13
to vim/vim, Subscribed
pierreganty created an issue (vim/vim#18567)

Steps to reproduce

:onoremap gb <cmd>normal! V<cr>
  1. Then typing cgb in Insert mode does require two <Esc> to exit into Normal mode.

Expected behaviour

Only one <Esc> to exit into Normal mode instead of two.

Version of Vim

9.1.754

Environment

macOS 15.7
ghostty 1.2.2
$TERM is xterm-ghostty

Logs and stack traces

See also for mor details / how we got there: https://github.com/neovim/neovim/issues/36119


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/18567@github.com>

Christian Brabandt

unread,
Oct 13, 2025, 4:49:43 PMOct 13
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#18567)

I think this fixes it, but not sure what this breaks:

diff --git a/src/ops.c b/src/ops.c
index 1544f34d4..9f094d625 100644
--- a/src/ops.c
+++ b/src/ops.c
@@ -4377,7 +4377,7 @@ do_pending_operator(cmdarg_T *cap, int old_col, int gui_yank)
                // remember it to make 'insertmode' work with mappings for
                // Visual mode.  But do this only once and not when typed and
                // 'insertmode' isn't set.
-               if (p_im || !KeyTyped)
+               if (p_im)
                    restart_edit_save = restart_edit;
                else
                    restart_edit_save = 0;


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/18567/3399032499@github.com>

Pierre Ganty

unread,
Oct 14, 2025, 9:27:15 AMOct 14
to vim/vim, Subscribed
pierreganty left a comment (vim/vim#18567)

The change worked for me. I observed one test failure related to xdg which is likely to be unrelated.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/18567/3401846367@github.com>

zeertzjq

unread,
Oct 16, 2025, 8:21:11 PMOct 16
to vim/vim, Subscribed
zeertzjq left a comment (vim/vim#18567)

Related: patch 6.0.056


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/18567/3413324917@github.com>

Christian Brabandt

unread,
Nov 12, 2025, 3:11:57 PM (13 hours ago) Nov 12
to vim/vim, Subscribed

Closed #18567 as not planned.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issue/18567/issue_event/20897720702@github.com>

Christian Brabandt

unread,
Nov 12, 2025, 3:11:57 PM (13 hours ago) Nov 12
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#18567)

Not intending to fix this as this might be a backwards incompatible change, as discussed in the related PR #18585


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/18567/3523720711@github.com>

Reply all
Reply to author
Forward
0 new messages