mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.2.3123: Vim9: confusing error when using white space after option
Problem: Vim9: confusing error when using white space after option, before one of "!&<". Solution: Give a specific error. (issue #8408)
This commit is contained in:
@@ -1230,9 +1230,10 @@ ex_set(exarg_T *eap)
|
||||
*/
|
||||
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];
|
||||
@@ -1387,7 +1388,11 @@ do_set(
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user