mirror of
https://github.com/vim/vim.git
synced 2025-11-14 23:04:02 -05: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:
@@ -9326,6 +9326,12 @@ ex_stopinsert(exarg_T *eap UNUSED)
|
||||
{
|
||||
restart_edit = 0;
|
||||
stop_insert_mode = TRUE;
|
||||
#if defined(FEAT_CLIENTSERVER) || defined(FEAT_EVAL)
|
||||
// when called from remote_expr in insert mode, make sure insert mode is
|
||||
// ended by adding K_NOP to the typeahead buffer
|
||||
if (vgetc_busy)
|
||||
ins_char_typebuf(K_NOP, 0);
|
||||
#endif
|
||||
clearmode();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user