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,9 +1306,10 @@ 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())
|
||||||
while (VIM_ISWHITE(arg[len]))
|
// skip white space, allow ":set ai ?", ":set hlsearch !"
|
||||||
++len;
|
while (VIM_ISWHITE(arg[len]))
|
||||||
|
++len;
|
||||||
|
|
||||||
adding = FALSE;
|
adding = FALSE;
|
||||||
prepending = FALSE;
|
prepending = FALSE;
|
||||||
|
@@ -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
|
||||||
|
@@ -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,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user