Skip to content

Commit 655a82a

Browse files
committed
patch 8.0.1804: using :normal in terminal window causes problems
Problem: Using :normal in terminal window causes problems. (Dominique Pelle) Solution: Don't call terminal_loop() for :normal. (closes #2886)
1 parent 9b50f36 commit 655a82a

4 files changed

Lines changed: 7 additions & 5 deletions

File tree

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
@@ -10323,14 +10323,14 @@ exec_normal_cmd(char_u *cmd, int remap, int silent)
1032310323
{
1032410324
/* Stuff the argument into the typeahead buffer. */
1032510325
ins_typebuf(cmd, remap, 0, TRUE, silent);
10326-
exec_normal(FALSE);
10326+
exec_normal(FALSE, FALSE);
1032710327
}
1032810328

1032910329
/*
1033010330
* Execute normal_cmd() until there is no typeahead left.
1033110331
*/
1033210332
void
10333-
exec_normal(int was_typed)
10333+
exec_normal(int was_typed, int may_use_terminal_loop UNUSED)
1033410334
{
1033510335
oparg_T oa;
1033610336

@@ -10341,7 +10341,7 @@ exec_normal(int was_typed)
1034110341
{
1034210342
update_topline_cursor();
1034310343
#ifdef FEAT_TERMINAL
10344-
if (term_use_loop()
10344+
if (may_use_terminal_loop && term_use_loop()
1034510345
&& oa.op_type == OP_NOP && oa.regname == NUL
1034610346
&& !VIsual_active)
1034710347
{

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);

src/version.c

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

762762
static int included_patches[] =
763763
{ /* Add new patch number below this line */
764+
/**/
765+
1804,
764766
/**/
765767
1803,
766768
/**/

0 commit comments

Comments
 (0)