0
0
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:
Bram Moolenaar
2021-07-08 16:40:13 +02:00
parent 30441bb3d5
commit 1594f31345
4 changed files with 28 additions and 10 deletions

View File

@@ -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;
}