0
0
mirror of https://github.com/vim/vim.git synced 2025-10-29 09:37:35 -04:00

patch 9.1.1295: clientserver: does not handle :stopinsert correctly

Problem:  clientserver: When in insert mode, a :stopinsert command
          is not correctly processed (user202729)
Solution: If the :stopinsert command is received while waiting for
          input, stuff the NOP key into the type-ahead buffer and
          detect that :stopinsert was used in edit() so that the
          cursor position is decremented.

fixes: #17016
closes: #17024

Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Christian Brabandt
2025-04-12 18:09:28 +02:00
parent 6f6c0dba9f
commit cf665ccd37
4 changed files with 59 additions and 1 deletions

View File

@@ -608,7 +608,16 @@ edit(
if (c != K_IGNORE && c != K_NOP)
vungetc(c);
count = 0;
nomove = TRUE;
if (!bt_prompt(curwin->w_buffer)
#ifdef FEAT_TERMINAL
&& !bt_terminal(curwin->w_buffer)
#endif
&& stop_insert_mode)
// :stopinsert command via callback or via server command
nomove = FALSE;
else
nomove = TRUE;
ins_compl_prep(ESC);
goto doESCkey;
}