Skip to content

Commit e3bfd2b

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents 25d758a + 39de952 commit e3bfd2b

7 files changed

Lines changed: 463 additions & 276 deletions

File tree

src/edit.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6199,6 +6199,8 @@ insertchar(
61996199
* 'paste' is set)..
62006200
* Don't do this when there an InsertCharPre autocommand is defined,
62016201
* because we need to fire the event for every character.
6202+
* Do the check for InsertCharPre before the call to vpeekc() because the
6203+
* InsertCharPre autocommand could change the input buffer.
62026204
*/
62036205
#ifdef USE_ON_FLY_SCROLL
62046206
dont_scroll = FALSE; /* allow scrolling here */
@@ -6208,6 +6210,7 @@ insertchar(
62086210
#ifdef FEAT_MBYTE
62096211
&& (!has_mbyte || (*mb_char2len)(c) == 1)
62106212
#endif
6213+
&& !has_insertcharpre()
62116214
&& vpeekc() != NUL
62126215
&& !(State & REPLACE_FLAG)
62136216
#ifdef FEAT_CINDENT
@@ -6216,7 +6219,7 @@ insertchar(
62166219
#ifdef FEAT_RIGHTLEFT
62176220
&& !p_ri
62186221
#endif
6219-
&& !has_insertcharpre())
6222+
)
62206223
{
62216224
#define INPUT_BUFLEN 100
62226225
char_u buf[INPUT_BUFLEN + 1];

src/evalfunc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3313,7 +3313,7 @@ f_feedkeys(typval_T *argvars, typval_T *rettv UNUSED)
33133313

33143314
if (!dangerous)
33153315
++ex_normal_busy;
3316-
exec_normal(TRUE);
3316+
exec_normal(TRUE, TRUE);
33173317
if (!dangerous)
33183318
--ex_normal_busy;
33193319

src/ex_docmd.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10350,14 +10350,14 @@ exec_normal_cmd(char_u *cmd, int remap, int silent)
1035010350
{
1035110351
/* Stuff the argument into the typeahead buffer. */
1035210352
ins_typebuf(cmd, remap, 0, TRUE, silent);
10353-
exec_normal(FALSE);
10353+
exec_normal(FALSE, FALSE);
1035410354
}
1035510355

1035610356
/*
1035710357
* Execute normal_cmd() until there is no typeahead left.
1035810358
*/
1035910359
void
10360-
exec_normal(int was_typed)
10360+
exec_normal(int was_typed, int may_use_terminal_loop UNUSED)
1036110361
{
1036210362
oparg_T oa;
1036310363

@@ -10368,7 +10368,7 @@ exec_normal(int was_typed)
1036810368
{
1036910369
update_topline_cursor();
1037010370
#ifdef FEAT_TERMINAL
10371-
if (term_use_loop()
10371+
if (may_use_terminal_loop && term_use_loop()
1037210372
&& oa.op_type == OP_NOP && oa.regname == NUL
1037310373
&& !VIsual_active)
1037410374
{

src/proto/ex_docmd.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ int save_current_state(save_state_T *sst);
5656
void restore_current_state(save_state_T *sst);
5757
void ex_normal(exarg_T *eap);
5858
void exec_normal_cmd(char_u *cmd, int remap, int silent);
59-
void exec_normal(int was_typed);
59+
void exec_normal(int was_typed, int may_use_terminal_loop);
6060
int find_cmdline_var(char_u *src, int *usedlen);
6161
char_u *eval_vars(char_u *src, char_u *srcstart, int *usedlen, linenr_T *lnump, char_u **errormsg, int *escaped);
6262
char_u *expand_sfile(char_u *arg);

0 commit comments

Comments
 (0)