mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 8.2.3124: Vim9: no error for white space between option and "=9"
Problem: Vim9: no error for white space between option and "=9". Solution: Check for extraneous white space. (issue #8408)
This commit is contained in:
17
src/option.c
17
src/option.c
@@ -1358,7 +1358,22 @@ do_set(
|
||||
// remember character after option name
|
||||
afterchar = arg[len];
|
||||
|
||||
if (!in_vim9script())
|
||||
if (in_vim9script())
|
||||
{
|
||||
char_u *p = skipwhite(arg + len);
|
||||
|
||||
// disallow white space before =val, +=val, -=val, ^=val
|
||||
if (p > arg + len && (p[0] == '='
|
||||
|| (vim_strchr((char_u *)"+-^", p[0]) != NULL
|
||||
&& p[1] == '=')))
|
||||
{
|
||||
errmsg = e_no_white_space_allowed_between_option_and;
|
||||
arg = p;
|
||||
startarg = p;
|
||||
goto skip;
|
||||
}
|
||||
}
|
||||
else
|
||||
// skip white space, allow ":set ai ?", ":set hlsearch !"
|
||||
while (VIM_ISWHITE(arg[len]))
|
||||
++len;
|
||||
|
Reference in New Issue
Block a user