INIT(= N_("E1203: Dot can only be used on a dictionary: %s"));
EXTERN char e_regexp_number_after_dot_pos_search[]
INIT(= N_("E1204: No Number allowed after .: '\\%%%c'"));
+EXTERN char e_no_white_space_allowed_between_option_and[]
+ INIT(= N_("E1205: No white space allowed between option and"));
*/
int
do_set(
- char_u *arg, // option string (may be written to!)
+ char_u *arg_start, // option string (may be written to!)
int opt_flags)
{
+ char_u *arg = arg_start;
int opt_idx;
char *errmsg;
char errbuf[80];
if (opt_idx == -1 && key == 0) // found a mismatch: skip
{
- errmsg = N_("E518: Unknown option");
+ if (in_vim9script() && arg > arg_start
+ && vim_strchr((char_u *)"!&<", *arg) != NULL)
+ errmsg = e_no_white_space_allowed_between_option_and;
+ else
+ errmsg = N_("E518: Unknown option");
goto skip;
}
enddef
def Test_option_modifier()
+ # legacy script allows for white space
var lines =<< trim END
set hlsearch & hlsearch !
call assert_equal(1, &hlsearch)
END
CheckScriptSuccess(lines)
+ set hlsearch
+ set hlsearch!
+ assert_equal(false, &hlsearch)
+
+ set hlsearch
+ set hlsearch&
+ assert_equal(false, &hlsearch)
+
lines =<< trim END
- vim9script
set hlsearch &
END
- CheckScriptFailure(lines, 'E518:')
+ CheckDefExecAndScriptFailure(lines, 'E1205: No white space allowed between option and: &')
lines =<< trim END
- vim9script
- set hlsearch & hlsearch !
+ set hlsearch !
END
- CheckScriptFailure(lines, 'E518:')
+ CheckDefExecAndScriptFailure(lines, 'E1205: No white space allowed between option and: !')
+
+ set hlsearch&
enddef
" Keep this last, it messes up highlighting.
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 3123,
/**/
3122,
/**/