diff options
-rw-r--r-- | src/ex_eval.c | 15 | ||||
-rw-r--r-- | src/testdir/test_vim9_cmd.vim | 10 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 25 insertions, 2 deletions
diff --git a/src/ex_eval.c b/src/ex_eval.c index f3e2ca28cf..61d288157d 100644 --- a/src/ex_eval.c +++ b/src/ex_eval.c @@ -888,8 +888,8 @@ report_discard_pending(int pending, void *value) } /* - * Return TRUE if "arg" is only a variable, register, environment variable or - * option name. + * Return TRUE if "arg" is only a variable, register, environment variable, + * option name or string. */ int cmd_is_name_only(char_u *arg) @@ -904,6 +904,17 @@ cmd_is_name_only(char_u *arg) if (*p != NUL) ++p; } + else if (*p == '\'' || *p == '"') + { + int r; + + if (*p == '"') + r = eval_string(&p, NULL, FALSE, FALSE); + else + r = eval_lit_string(&p, NULL, FALSE, FALSE); + if (r == FAIL) + return FALSE; + } else { if (*p == '&') diff --git a/src/testdir/test_vim9_cmd.vim b/src/testdir/test_vim9_cmd.vim index 50719e1b54..77e1d8a069 100644 --- a/src/testdir/test_vim9_cmd.vim +++ b/src/testdir/test_vim9_cmd.vim @@ -697,6 +697,16 @@ def Test_use_register() END v9.CheckDefAndScriptFailure(lines, 'E1207:', 2) $SomeEnv = '' + + lines =<< trim END + eval 'value' + END + v9.CheckDefAndScriptFailure(lines, 'E1207:', 1) + + lines =<< trim END + eval "value" + END + v9.CheckDefAndScriptFailure(lines, 'E1207:', 1) enddef def Test_environment_use_linebreak() diff --git a/src/version.c b/src/version.c index 485e25780b..7bdf346336 100644 --- a/src/version.c +++ b/src/version.c @@ -747,6 +747,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 4970, +/**/ 4969, /**/ 4968, |