0
0
mirror of https://github.com/vim/vim.git synced 2025-09-30 04:44:14 -04:00

patch 8.2.3021: spaces allowed between option name and "!", "?", etc.

Problem:    Spaces allowed between option name and "!", "?", etc.
Solution:   Disallow spaces in Vim9 script, it was not documented.
            (closes #8408)
This commit is contained in:
Bram Moolenaar
2021-06-20 12:40:08 +02:00
parent 2fb7495686
commit 208f0b48b2
3 changed files with 26 additions and 3 deletions

View File

@@ -1306,7 +1306,8 @@ do_set(
// remember character after option name // remember character after option name
afterchar = arg[len]; afterchar = arg[len];
// skip white space, allow ":set ai ?" if (!in_vim9script())
// skip white space, allow ":set ai ?", ":set hlsearch !"
while (VIM_ISWHITE(arg[len])) while (VIM_ISWHITE(arg[len]))
++len; ++len;

View File

@@ -3937,6 +3937,26 @@ def Test_mapping_line_number()
delfunc g:FuncA delfunc g:FuncA
enddef 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. " Keep this last, it messes up highlighting.
def Test_substitute_cmd() def Test_substitute_cmd()
new new

View File

@@ -750,6 +750,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
3021,
/**/ /**/
3020, 3020,
/**/ /**/