vim-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 vim/vim#1883)
            Also complete commands.
67883b4909
This commit is contained in:
Jan Edmund Lazo 2019-05-28 22:52:14 -04:00
parent f8f63393c1
commit 18c2ae7284

View File

@ -1957,6 +1957,7 @@ static char_u * do_one_cmd(char_u **cmdlinep,
* 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) {
@ -4122,13 +4123,14 @@ int expand_filename(exarg_T *eap, char_u **cmdlinep, char_u **errormsgp)
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
&& !(eap->argt & NOSPC) && !(eap->argt & NOSPC)
) { ) {
char_u *l; char_u *l;
@ -4151,7 +4153,9 @@ int expand_filename(exarg_T *eap, char_u **cmdlinep, char_u **errormsgp)
} }
/* 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;
@ -8399,7 +8403,7 @@ static void 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)) {
@ -9046,7 +9050,7 @@ makeopens(
for (wp = tab_firstwin; wp != NULL; wp = wp->w_next) { for (wp = tab_firstwin; wp != NULL; wp = wp->w_next) {
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)
&& !bt_nofile(wp->w_buffer) && !bt_nofile(wp->w_buffer)
) { ) {
if (fputs(need_tabnew ? "tabedit " : "edit ", fd) < 0 if (fputs(need_tabnew ? "tabedit " : "edit ", fd) < 0
@ -9337,7 +9341,7 @@ static int ses_do_win(win_T *wp)
|| (!wp->w_buffer->terminal && bt_nofile(wp->w_buffer))) { || (!wp->w_buffer->terminal && bt_nofile(wp->w_buffer))) {
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;
@ -9477,7 +9481,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;