mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
commit
c6cd6081b8
@ -1948,28 +1948,26 @@ static char_u * do_one_cmd(char_u **cmdlinep,
|
|||||||
* Check for '|' to separate commands and '"' to start comments.
|
* Check for '|' to separate commands and '"' to start comments.
|
||||||
* Don't do this for ":read !cmd" and ":write !cmd".
|
* Don't do this for ":read !cmd" and ":write !cmd".
|
||||||
*/
|
*/
|
||||||
if ((ea.argt & TRLBAR) && !ea.usefilter)
|
if ((ea.argt & TRLBAR) && !ea.usefilter) {
|
||||||
separate_nextcmd(&ea);
|
separate_nextcmd(&ea);
|
||||||
|
} else if (ea.cmdidx == CMD_bang
|
||||||
/*
|
|| ea.cmdidx == CMD_terminal
|
||||||
* Check for <newline> to end a shell command.
|
|| ea.cmdidx == CMD_global
|
||||||
* Also do this for ":read !cmd", ":write !cmd" and ":global".
|
|| ea.cmdidx == CMD_vglobal
|
||||||
* Any others?
|
|| ea.usefilter) {
|
||||||
*/
|
// Check for <newline> to end a shell command.
|
||||||
else if (ea.cmdidx == CMD_bang
|
// Also do this for ":read !cmd", ":write !cmd" and ":global".
|
||||||
|| ea.cmdidx == CMD_global
|
// Any others?
|
||||||
|| ea.cmdidx == CMD_vglobal
|
for (p = ea.arg; *p; p++) {
|
||||||
|| ea.usefilter) {
|
// Remove one backslash before a newline, so that it's possible to
|
||||||
for (p = ea.arg; *p; ++p) {
|
// pass a newline to the shell and also a newline that is preceded
|
||||||
/* Remove one backslash before a newline, so that it's possible to
|
// with a backslash. This makes it impossible to end a shell
|
||||||
* pass a newline to the shell and also a newline that is preceded
|
// command in a backslash, but that doesn't appear useful.
|
||||||
* with a backslash. This makes it impossible to end a shell
|
// Halving the number of backslashes is incompatible with previous
|
||||||
* command in a backslash, but that doesn't appear useful.
|
// versions.
|
||||||
* Halving the number of backslashes is incompatible with previous
|
if (*p == '\\' && p[1] == '\n') {
|
||||||
* versions. */
|
|
||||||
if (*p == '\\' && p[1] == '\n')
|
|
||||||
STRMOVE(p, p + 1);
|
STRMOVE(p, p + 1);
|
||||||
else if (*p == '\n') {
|
} else if (*p == '\n') {
|
||||||
ea.nextcmd = p + 1;
|
ea.nextcmd = p + 1;
|
||||||
*p = NUL;
|
*p = NUL;
|
||||||
break;
|
break;
|
||||||
@ -4122,13 +4120,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;
|
||||||
@ -4150,8 +4149,10 @@ 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 +8400,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 +9047,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 +9338,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 +9478,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;
|
||||||
|
Loading…
Reference in New Issue
Block a user