0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.0.0785: wildcards are not expanded for :terminal

Problem:    Wildcards are not expanded for :terminal.
Solution:   Add FILES to the command flags. (Yasuhiro Matsumoto, closes #1883)
            Also complete commands.
This commit is contained in:
Bram Moolenaar
2017-07-27 22:57:00 +02:00
parent a2c45a17c1
commit 67883b4909
3 changed files with 16 additions and 11 deletions

View File

@@ -1484,7 +1484,7 @@ EX(CMD_tearoff, "tearoff", ex_tearoff,
NEEDARG|EXTRA|TRLBAR|NOTRLCOM|CMDWIN, NEEDARG|EXTRA|TRLBAR|NOTRLCOM|CMDWIN,
ADDR_LINES), ADDR_LINES),
EX(CMD_terminal, "terminal", ex_terminal, EX(CMD_terminal, "terminal", ex_terminal,
RANGE|NOTADR|EXTRA|TRLBAR|CMDWIN, RANGE|NOTADR|FILES|TRLBAR|CMDWIN,
ADDR_OTHER), ADDR_OTHER),
EX(CMD_tfirst, "tfirst", ex_tag, EX(CMD_tfirst, "tfirst", ex_tag,
RANGE|NOTADR|BANG|TRLBAR|ZEROR, RANGE|NOTADR|BANG|TRLBAR|ZEROR,

View File

@@ -2632,6 +2632,7 @@ do_one_cmd(
* Any others? * Any others?
*/ */
else if (ea.cmdidx == CMD_bang else if (ea.cmdidx == CMD_bang
|| ea.cmdidx == CMD_terminal
|| ea.cmdidx == CMD_global || ea.cmdidx == CMD_global
|| ea.cmdidx == CMD_vglobal || ea.cmdidx == CMD_vglobal
|| ea.usefilter) || ea.usefilter)
@@ -3788,7 +3789,7 @@ set_one_cmd_context(
xp->xp_context = EXPAND_FILES; xp->xp_context = EXPAND_FILES;
/* For a shell command more chars need to be escaped. */ /* For a shell command more chars need to be escaped. */
if (usefilter || ea.cmdidx == CMD_bang) if (usefilter || ea.cmdidx == CMD_bang || ea.cmdidx == CMD_terminal)
{ {
#ifndef BACKSLASH_IN_FILENAME #ifndef BACKSLASH_IN_FILENAME
xp->xp_shell = TRUE; xp->xp_shell = TRUE;
@@ -5040,13 +5041,14 @@ expand_filename(
if (!eap->usefilter if (!eap->usefilter
&& !escaped && !escaped
&& eap->cmdidx != CMD_bang && eap->cmdidx != CMD_bang
&& eap->cmdidx != CMD_make
&& eap->cmdidx != CMD_lmake
&& eap->cmdidx != CMD_grep && eap->cmdidx != CMD_grep
&& eap->cmdidx != CMD_lgrep
&& eap->cmdidx != CMD_grepadd && eap->cmdidx != CMD_grepadd
&& eap->cmdidx != CMD_lgrepadd
&& eap->cmdidx != CMD_hardcopy && eap->cmdidx != CMD_hardcopy
&& eap->cmdidx != CMD_lgrep
&& eap->cmdidx != CMD_lgrepadd
&& eap->cmdidx != CMD_lmake
&& eap->cmdidx != CMD_make
&& eap->cmdidx != CMD_terminal
#ifndef UNIX #ifndef UNIX
&& !(eap->argt & NOSPC) && !(eap->argt & NOSPC)
#endif #endif
@@ -5076,7 +5078,8 @@ expand_filename(
} }
/* For a shell command a '!' must be escaped. */ /* For a shell command a '!' must be escaped. */
if ((eap->usefilter || eap->cmdidx == CMD_bang) if ((eap->usefilter || eap->cmdidx == CMD_bang
|| eap->cmdidx == CMD_terminal)
&& vim_strpbrk(repl, (char_u *)"!") != NULL) && vim_strpbrk(repl, (char_u *)"!") != NULL)
{ {
char_u *l; char_u *l;
@@ -10516,7 +10519,7 @@ ex_pedit(exarg_T *eap)
g_do_tagpreview = p_pvh; g_do_tagpreview = p_pvh;
prepare_tagpreview(TRUE); prepare_tagpreview(TRUE);
keep_help_flag = curwin_save->w_buffer->b_help; keep_help_flag = bt_help(curwin_save->w_buffer);
do_exedit(eap, NULL); do_exedit(eap, NULL);
keep_help_flag = FALSE; keep_help_flag = FALSE;
if (curwin != curwin_save && win_valid(curwin_save)) if (curwin != curwin_save && win_valid(curwin_save))
@@ -11265,7 +11268,7 @@ makeopens(
{ {
if (ses_do_win(wp) if (ses_do_win(wp)
&& wp->w_buffer->b_ffname != NULL && wp->w_buffer->b_ffname != NULL
&& !wp->w_buffer->b_help && !bt_help(wp->w_buffer)
#ifdef FEAT_QUICKFIX #ifdef FEAT_QUICKFIX
&& !bt_nofile(wp->w_buffer) && !bt_nofile(wp->w_buffer)
#endif #endif
@@ -11549,7 +11552,7 @@ ses_do_win(win_T *wp)
#endif #endif
) )
return (ssop_flags & SSOP_BLANK); return (ssop_flags & SSOP_BLANK);
if (wp->w_buffer->b_help) if (bt_help(wp->w_buffer))
return (ssop_flags & SSOP_HELP); return (ssop_flags & SSOP_HELP);
return TRUE; return TRUE;
} }
@@ -11679,7 +11682,7 @@ put_view(
*/ */
if ((*flagp & SSOP_FOLDS) if ((*flagp & SSOP_FOLDS)
&& wp->w_buffer->b_ffname != NULL && wp->w_buffer->b_ffname != NULL
&& (*wp->w_buffer->b_p_bt == NUL || wp->w_buffer->b_help)) && (*wp->w_buffer->b_p_bt == NUL || bt_help(wp->w_buffer)))
{ {
if (put_folds(fd, wp) == FAIL) if (put_folds(fd, wp) == FAIL)
return FAIL; return FAIL;

View File

@@ -769,6 +769,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
785,
/**/ /**/
784, 784,
/**/ /**/