1
0
forked from aniani/vim

patch 8.2.2138: Vim9: "exit_cb" causes Vim to exit

Problem:    Vim9: "exit_cb" causes Vim to exit.
Solution:   Require white space after a command in Vim9 script. (closes #7467)
            Also fix that Vim9 style heredoc was not always recognized.
This commit is contained in:
Bram Moolenaar
2020-12-13 17:50:20 +01:00
parent e498429087
commit b5b9480ee9
8 changed files with 59 additions and 18 deletions

View File

@@ -3528,6 +3528,14 @@ find_ex_command(
if (eap->cmdidx == CMD_final && p - eap->cmd == 4)
eap->cmdidx = CMD_finally;
if (eap->cmdidx != CMD_SIZE && in_vim9script()
&& !IS_WHITE_OR_NUL(*p) && !ends_excmd(*p) && *p != '!'
&& (cmdnames[eap->cmdidx].cmd_argt & EX_NONWHITE_OK) == 0)
{
semsg(_(e_command_not_followed_by_white_space_str), eap->cmd);
eap->cmdidx = CMD_SIZE;
}
return p;
}
@@ -5114,7 +5122,7 @@ ex_blast(exarg_T *eap)
/*
* Check if "c" ends an Ex command.
* In Vim9 script does not check for white space before # or #{.
* In Vim9 script does not check for white space before #.
*/
int
ends_excmd(int c)