Skip to content

Commit

Permalink
patch 8.1.0082: in terminal window, typing : at more prompt, inserts ':'
Browse files Browse the repository at this point in the history
Problem:    In terminal window, typing : at more prompt, inserts ':' instead
            of starting another Ex command.
Solution:   Add skip_term_loop and set it when putting ':' in the typeahead
            buffer.
  • Loading branch information
brammool committed Jun 19, 2018
1 parent f07f9e7 commit 1d4754f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/globals.h
Expand Up @@ -371,6 +371,11 @@ EXTERN int highlight_stltermnc[9]; /* On top of user */
# endif
# endif
#endif
#ifdef FEAT_TERMINAL
// When TRUE skip calling terminal_loop() once. Used when
// typing ':' at the more prompt.
EXTERN int skip_term_loop INIT(= FALSE);
#endif
#ifdef FEAT_GUI
EXTERN char_u *use_gvimrc INIT(= NULL); /* "-U" cmdline argument */
#endif
Expand Down
10 changes: 8 additions & 2 deletions src/main.c
Expand Up @@ -1339,7 +1339,8 @@ main_loop(
#ifdef FEAT_TERMINAL
if (term_use_loop()
&& oa.op_type == OP_NOP && oa.regname == NUL
&& !VIsual_active)
&& !VIsual_active
&& !skip_term_loop)
{
/* If terminal_loop() returns OK we got a key that is handled
* in Normal model. With FAIL we first need to position the
Expand All @@ -1348,8 +1349,13 @@ main_loop(
normal_cmd(&oa, TRUE);
}
else
#endif
{
#ifdef FEAT_TERMINAL
skip_term_loop = FALSE;
#endif
normal_cmd(&oa, TRUE);
}
}
}
}
Expand Down Expand Up @@ -3320,7 +3326,7 @@ usage(void)
main_msg(_("-dev <device>\t\tUse <device> for I/O"));
#endif
#ifdef FEAT_ARABIC
main_msg(_("-A\t\t\tstart in Arabic mode"));
main_msg(_("-A\t\t\tStart in Arabic mode"));
#endif
#ifdef FEAT_RIGHTLEFT
main_msg(_("-H\t\t\tStart in Hebrew mode"));
Expand Down
6 changes: 6 additions & 0 deletions src/message.c
Expand Up @@ -1219,6 +1219,9 @@ wait_return(int redraw)
cmdline_row = msg_row;
skip_redraw = TRUE; /* skip redraw once */
do_redraw = FALSE;
#ifdef FEAT_TERMINAL
skip_term_loop = TRUE;
#endif
}

/*
Expand Down Expand Up @@ -2827,6 +2830,9 @@ do_more_prompt(int typed_char)
/* Since got_int is set all typeahead will be flushed, but we
* want to keep this ':', remember that in a special way. */
typeahead_noflush(':');
#ifdef FEAT_TERMINAL
skip_term_loop = TRUE;
#endif
cmdline_row = Rows - 1; /* put ':' on this line */
skip_redraw = TRUE; /* skip redraw once */
need_wait_return = FALSE; /* don't wait in main() */
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 */
/**/
82,
/**/
81,
/**/
Expand Down

0 comments on commit 1d4754f

Please sign in to comment.