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:
11
src/edit.c
11
src/edit.c
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user