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:
@@ -1306,7 +1306,8 @@ do_set(
|
||||
// remember character after option name
|
||||
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]))
|
||||
++len;
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -750,6 +750,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
3021,
|
||||
/**/
|
||||
3020,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user