Skip to content

Commit 245c410

Browse files
committed
patch 7.4.1758
Problem: Triggering CursorHoldI when in CTRL-X mode causes problems. Solution: Do not trigger CursorHoldI in CTRL-X mode. Add "!" flag to feedkeys() (test with that didn't work though).
1 parent 8e42ae5 commit 245c410

3 files changed

Lines changed: 14 additions & 3 deletions

File tree

src/edit.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1526,7 +1526,12 @@ edit(
15261526

15271527
#ifdef FEAT_AUTOCMD
15281528
/* If typed something may trigger CursorHoldI again. */
1529-
if (c != K_CURSORHOLD)
1529+
if (c != K_CURSORHOLD
1530+
# ifdef FEAT_COMPL_FUNC
1531+
/* but not in CTRL-X mode, a script can't restore the state */
1532+
&& ctrl_x_mode == 0
1533+
# endif
1534+
)
15301535
did_cursorhold = FALSE;
15311536
#endif
15321537

src/eval.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11547,6 +11547,7 @@ f_feedkeys(typval_T *argvars, typval_T *rettv UNUSED)
1154711547
char_u nbuf[NUMBUFLEN];
1154811548
int typed = FALSE;
1154911549
int execute = FALSE;
11550+
int dangerous = FALSE;
1155011551
char_u *keys_esc;
1155111552

1155211553
/* This is not allowed in the sandbox. If the commands would still be
@@ -11569,6 +11570,7 @@ f_feedkeys(typval_T *argvars, typval_T *rettv UNUSED)
1156911570
case 't': typed = TRUE; break;
1157011571
case 'i': insert = TRUE; break;
1157111572
case 'x': execute = TRUE; break;
11573+
case '!': dangerous = TRUE; break;
1157211574
}
1157311575
}
1157411576
}
@@ -11592,9 +11594,11 @@ f_feedkeys(typval_T *argvars, typval_T *rettv UNUSED)
1159211594
/* Avoid a 1 second delay when the keys start Insert mode. */
1159311595
msg_scroll = FALSE;
1159411596

11595-
++ex_normal_busy;
11597+
if (!dangerous)
11598+
++ex_normal_busy;
1159611599
exec_normal(TRUE);
11597-
--ex_normal_busy;
11600+
if (!dangerous)
11601+
--ex_normal_busy;
1159811602
msg_scroll |= save_msg_scroll;
1159911603
}
1160011604
}

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,8 @@ static char *(features[]) =
748748

749749
static int included_patches[] =
750750
{ /* Add new patch number below this line */
751+
/**/
752+
1758,
751753
/**/
752754
1757,
753755
/**/

0 commit comments

Comments
 (0)