#ifdef FEAT_EVAL
if (eap->cmdidx < CMD_SIZE
&& vim9
- && !IS_WHITE_OR_NUL(*p) && *p != '\n' && *p != '!' && *p != '|'
+ && !IS_WHITE_NL_OR_NUL(*p) && *p != '!' && *p != '|'
&& (eap->cmdidx < 0 ||
(cmdnames[eap->cmdidx].cmd_argt & EX_NONWHITE_OK) == 0))
{
had_comma = **arg == ',';
if (had_comma)
{
- if (vim9script && !IS_WHITE_OR_NUL((*arg)[1]) && (*arg)[1] != ']')
+ if (vim9script && !IS_WHITE_NL_OR_NUL((*arg)[1]) && (*arg)[1] != ']')
{
semsg(_(e_white_space_required_after_str_str), ",", *arg);
goto failret;
*/
#define VIM_ISWHITE(x) ((x) == ' ' || (x) == '\t')
#define IS_WHITE_OR_NUL(x) ((x) == ' ' || (x) == '\t' || (x) == NUL)
+#define IS_WHITE_NL_OR_NUL(x) ((x) == ' ' || (x) == '\t' || (x) == '\n' || (x) == NUL)
/*
* LINEEMPTY() - return TRUE if the line is empty
let file = 'crash/vim_regsub_both_poc'
let args = printf(cmn_args, vim, file)
- " using || because this poc causes vim to exit with exitstatus != 0
call term_sendkeys(buf, args ..
\ ' && echo "crash 7: [OK]" >> X_crash1_result.txt' .. "\<cr>")
call TermWait(buf, 1000)
END
call v9.CheckScriptFailure(lines, 'E1128:')
delcommand BadCommand
+
+ let lines =<< trim END
+ vim9script
+ command Cmd {
+ g:result = [1,
+ 2]
+ }
+ Cmd
+ END
+ call v9.CheckScriptSuccess(lines)
+ call assert_equal([1, 2], g:result)
+ delcommand Cmd
+ unlet! g:result
+
+ let lines =<< trim END
+ vim9script
+ command Cmd {
+ g:result = and(0x80,
+ 0x80)
+ }
+ Cmd
+ END
+ call v9.CheckScriptSuccess(lines)
+ call assert_equal(128, g:result)
+ delcommand Cmd
+ unlet! g:result
+
endfunc
func Test_delcommand_buffer()
argp = skipwhite(argp);
if (*argp != ',')
break;
- if (vim9script && !IS_WHITE_OR_NUL(argp[1]))
+ if (vim9script && !IS_WHITE_NL_OR_NUL(argp[1]))
{
if (evaluate)
semsg(_(e_white_space_required_after_str_str), ",", argp);
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1876,
/**/
1875,
/**/