Skip to content

Commit

Permalink
patch 8.0.1804: using :normal in terminal window causes problems
Browse files Browse the repository at this point in the history
Problem:    Using :normal in terminal window causes problems. (Dominique
            Pelle)
Solution:   Don't call terminal_loop() for :normal. (closes #2886)
  • Loading branch information
brammool committed May 8, 2018
1 parent 9b50f36 commit 655a82a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/evalfunc.c
Expand Up @@ -3313,7 +3313,7 @@ f_feedkeys(typval_T *argvars, typval_T *rettv UNUSED)

if (!dangerous)
++ex_normal_busy;
exec_normal(TRUE);
exec_normal(TRUE, TRUE);
if (!dangerous)
--ex_normal_busy;

Expand Down
6 changes: 3 additions & 3 deletions src/ex_docmd.c
Expand Up @@ -10323,14 +10323,14 @@ exec_normal_cmd(char_u *cmd, int remap, int silent)
{
/* Stuff the argument into the typeahead buffer. */
ins_typebuf(cmd, remap, 0, TRUE, silent);
exec_normal(FALSE);
exec_normal(FALSE, FALSE);
}

/*
* Execute normal_cmd() until there is no typeahead left.
*/
void
exec_normal(int was_typed)
exec_normal(int was_typed, int may_use_terminal_loop UNUSED)
{
oparg_T oa;

Expand All @@ -10341,7 +10341,7 @@ exec_normal(int was_typed)
{
update_topline_cursor();
#ifdef FEAT_TERMINAL
if (term_use_loop()
if (may_use_terminal_loop && term_use_loop()
&& oa.op_type == OP_NOP && oa.regname == NUL
&& !VIsual_active)
{
Expand Down
2 changes: 1 addition & 1 deletion src/proto/ex_docmd.pro
Expand Up @@ -56,7 +56,7 @@ int save_current_state(save_state_T *sst);
void restore_current_state(save_state_T *sst);
void ex_normal(exarg_T *eap);
void exec_normal_cmd(char_u *cmd, int remap, int silent);
void exec_normal(int was_typed);
void exec_normal(int was_typed, int may_use_terminal_loop);
int find_cmdline_var(char_u *src, int *usedlen);
char_u *eval_vars(char_u *src, char_u *srcstart, int *usedlen, linenr_T *lnump, char_u **errormsg, int *escaped);
char_u *expand_sfile(char_u *arg);
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -761,6 +761,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1804,
/**/
1803,
/**/
Expand Down

0 comments on commit 655a82a

Please sign in to comment.