summaryrefslogtreecommitdiffstats
path: root/src/edit.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-12-01 12:03:47 +0000
committerBram Moolenaar <Bram@vim.org>2022-12-01 12:03:47 +0000
commit733a69b29f0b0c3d2ddca463a41bdd912379bc5e (patch)
tree65bc4282dda846e701691450320de90c07cf5e44 /src/edit.c
parent4f501171f7ba8fe3d24c7e5bf5fcec5b5f246df1 (diff)
patch 9.0.0980: the keyboard state response may end up in a shell commandv9.0.0980
Problem: The keyboard state response may end up in a shell command. Solution: Only request the keyboard protocol state when the typeahead is empty, no more commands are following and not exiting. Add the t_RK termcap entry for this.
Diffstat (limited to 'src/edit.c')
-rw-r--r--src/edit.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/edit.c b/src/edit.c
index 01e5cc2d3e..43f7d9abb0 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -571,6 +571,8 @@ edit(
#ifdef USE_ON_FLY_SCROLL
dont_scroll = FALSE; // allow scrolling here
#endif
+ // May request the keyboard protocol state now.
+ may_send_t_RK();
/*
* Get a character for Insert mode. Ignore K_IGNORE and K_NOP.
@@ -1479,7 +1481,8 @@ ins_redraw(int ready) // not busy with something
aco_save_T aco;
varnumber_T tick = CHANGEDTICK(curbuf);
- // save and restore curwin and curbuf, in case the autocmd changes them
+ // Save and restore curwin and curbuf, in case the autocmd changes
+ // them.
aucmd_prepbuf(&aco, curbuf);
apply_autocmds(EVENT_TEXTCHANGEDI, NULL, NULL, FALSE, curbuf);
aucmd_restbuf(&aco);
@@ -1499,7 +1502,8 @@ ins_redraw(int ready) // not busy with something
aco_save_T aco;
varnumber_T tick = CHANGEDTICK(curbuf);
- // save and restore curwin and curbuf, in case the autocmd changes them
+ // Save and restore curwin and curbuf, in case the autocmd changes
+ // them.
aucmd_prepbuf(&aco, curbuf);
apply_autocmds(EVENT_TEXTCHANGEDP, NULL, NULL, FALSE, curbuf);
aucmd_restbuf(&aco);
@@ -3706,7 +3710,7 @@ ins_esc(
out_str(T_BE);
// Re-enable modifyOtherKeys.
- out_str(T_CTI);
+ out_str_t_TI();
}
#ifdef FEAT_CONCEAL
// Check if the cursor line needs redrawing after changing State. If
@@ -4384,6 +4388,7 @@ bracketed_paste(paste_mode_T mode, int drop, garray_T *gap)
do
c = vgetc();
while (c == K_IGNORE || c == K_VER_SCROLLBAR || c == K_HOR_SCROLLBAR);
+
if (c == NUL || got_int || (ex_normal_busy > 0 && c == Ctrl_C))
// When CTRL-C was encountered the typeahead will be flushed and we
// won't get the end sequence. Except when using ":normal".