Skip to content

Commit 67883b4

Browse files
committed
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.
1 parent a2c45a1 commit 67883b4

3 files changed

Lines changed: 16 additions & 11 deletions

File tree

src/ex_cmds.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1484,7 +1484,7 @@ EX(CMD_tearoff, "tearoff", ex_tearoff,
14841484
NEEDARG|EXTRA|TRLBAR|NOTRLCOM|CMDWIN,
14851485
ADDR_LINES),
14861486
EX(CMD_terminal, "terminal", ex_terminal,
1487-
RANGE|NOTADR|EXTRA|TRLBAR|CMDWIN,
1487+
RANGE|NOTADR|FILES|TRLBAR|CMDWIN,
14881488
ADDR_OTHER),
14891489
EX(CMD_tfirst, "tfirst", ex_tag,
14901490
RANGE|NOTADR|BANG|TRLBAR|ZEROR,

src/ex_docmd.c

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2632,6 +2632,7 @@ do_one_cmd(
26322632
* Any others?
26332633
*/
26342634
else if (ea.cmdidx == CMD_bang
2635+
|| ea.cmdidx == CMD_terminal
26352636
|| ea.cmdidx == CMD_global
26362637
|| ea.cmdidx == CMD_vglobal
26372638
|| ea.usefilter)
@@ -3788,7 +3789,7 @@ set_one_cmd_context(
37883789
xp->xp_context = EXPAND_FILES;
37893790

37903791
/* For a shell command more chars need to be escaped. */
3791-
if (usefilter || ea.cmdidx == CMD_bang)
3792+
if (usefilter || ea.cmdidx == CMD_bang || ea.cmdidx == CMD_terminal)
37923793
{
37933794
#ifndef BACKSLASH_IN_FILENAME
37943795
xp->xp_shell = TRUE;
@@ -5040,13 +5041,14 @@ expand_filename(
50405041
if (!eap->usefilter
50415042
&& !escaped
50425043
&& eap->cmdidx != CMD_bang
5043-
&& eap->cmdidx != CMD_make
5044-
&& eap->cmdidx != CMD_lmake
50455044
&& eap->cmdidx != CMD_grep
5046-
&& eap->cmdidx != CMD_lgrep
50475045
&& eap->cmdidx != CMD_grepadd
5048-
&& eap->cmdidx != CMD_lgrepadd
50495046
&& eap->cmdidx != CMD_hardcopy
5047+
&& eap->cmdidx != CMD_lgrep
5048+
&& eap->cmdidx != CMD_lgrepadd
5049+
&& eap->cmdidx != CMD_lmake
5050+
&& eap->cmdidx != CMD_make
5051+
&& eap->cmdidx != CMD_terminal
50505052
#ifndef UNIX
50515053
&& !(eap->argt & NOSPC)
50525054
#endif
@@ -5076,7 +5078,8 @@ expand_filename(
50765078
}
50775079

50785080
/* For a shell command a '!' must be escaped. */
5079-
if ((eap->usefilter || eap->cmdidx == CMD_bang)
5081+
if ((eap->usefilter || eap->cmdidx == CMD_bang
5082+
|| eap->cmdidx == CMD_terminal)
50805083
&& vim_strpbrk(repl, (char_u *)"!") != NULL)
50815084
{
50825085
char_u *l;
@@ -10516,7 +10519,7 @@ ex_pedit(exarg_T *eap)
1051610519

1051710520
g_do_tagpreview = p_pvh;
1051810521
prepare_tagpreview(TRUE);
10519-
keep_help_flag = curwin_save->w_buffer->b_help;
10522+
keep_help_flag = bt_help(curwin_save->w_buffer);
1052010523
do_exedit(eap, NULL);
1052110524
keep_help_flag = FALSE;
1052210525
if (curwin != curwin_save && win_valid(curwin_save))
@@ -11265,7 +11268,7 @@ makeopens(
1126511268
{
1126611269
if (ses_do_win(wp)
1126711270
&& wp->w_buffer->b_ffname != NULL
11268-
&& !wp->w_buffer->b_help
11271+
&& !bt_help(wp->w_buffer)
1126911272
#ifdef FEAT_QUICKFIX
1127011273
&& !bt_nofile(wp->w_buffer)
1127111274
#endif
@@ -11549,7 +11552,7 @@ ses_do_win(win_T *wp)
1154911552
#endif
1155011553
)
1155111554
return (ssop_flags & SSOP_BLANK);
11552-
if (wp->w_buffer->b_help)
11555+
if (bt_help(wp->w_buffer))
1155311556
return (ssop_flags & SSOP_HELP);
1155411557
return TRUE;
1155511558
}
@@ -11679,7 +11682,7 @@ put_view(
1167911682
*/
1168011683
if ((*flagp & SSOP_FOLDS)
1168111684
&& wp->w_buffer->b_ffname != NULL
11682-
&& (*wp->w_buffer->b_p_bt == NUL || wp->w_buffer->b_help))
11685+
&& (*wp->w_buffer->b_p_bt == NUL || bt_help(wp->w_buffer)))
1168311686
{
1168411687
if (put_folds(fd, wp) == FAIL)
1168511688
return FAIL;

src/version.c

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

770770
static int included_patches[] =
771771
{ /* Add new patch number below this line */
772+
/**/
773+
785,
772774
/**/
773775
784,
774776
/**/

0 commit comments

Comments
 (0)