diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/option.c | 7 | ||||
-rw-r--r-- | src/testdir/test_vim9_script.vim | 20 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 26 insertions, 3 deletions
diff --git a/src/option.c b/src/option.c index dd44fe4ac..535213c19 100644 --- a/src/option.c +++ b/src/option.c @@ -1306,9 +1306,10 @@ do_set( // remember character after option name afterchar = arg[len]; - // skip white space, allow ":set ai ?" - while (VIM_ISWHITE(arg[len])) - ++len; + if (!in_vim9script()) + // skip white space, allow ":set ai ?", ":set hlsearch !" + while (VIM_ISWHITE(arg[len])) + ++len; adding = FALSE; prepending = FALSE; diff --git a/src/testdir/test_vim9_script.vim b/src/testdir/test_vim9_script.vim index 4b0ab2bad..1584f173a 100644 --- a/src/testdir/test_vim9_script.vim +++ b/src/testdir/test_vim9_script.vim @@ -3937,6 +3937,26 @@ def Test_mapping_line_number() delfunc g:FuncA enddef +def Test_option_modifier() + var lines =<< trim END + set hlsearch & hlsearch ! + call assert_equal(1, &hlsearch) + END + CheckScriptSuccess(lines) + + lines =<< trim END + vim9script + set hlsearch & + END + CheckScriptFailure(lines, 'E518:') + + lines =<< trim END + vim9script + set hlsearch & hlsearch ! + END + CheckScriptFailure(lines, 'E518:') +enddef + " Keep this last, it messes up highlighting. def Test_substitute_cmd() new diff --git a/src/version.c b/src/version.c index d1201f4f6..d217fe615 100644 --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 3021, +/**/ 3020, /**/ 3019, |