0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.3111: Vim9: confusing error with extra whitespace before colon

Problem:    Vim9: confusing error with extra whitespace before colon.
Solution:   Check for colon after white space. (closes #8513)
This commit is contained in:
Bram Moolenaar
2021-07-05 21:41:48 +02:00
parent 04db26b360
commit 404557e6a6
4 changed files with 22 additions and 5 deletions

View File

@@ -7775,7 +7775,10 @@ compile_for(char_u *arg_start, cctx_T *cctx)
return NULL;
if (STRNCMP(p, "in", 2) != 0 || !IS_WHITE_OR_NUL(p[2]))
{
emsg(_(e_missing_in));
if (*p == ':' && wp != p)
semsg(_(e_no_white_space_allowed_before_colon_str), p);
else
emsg(_(e_missing_in));
return NULL;
}
wp = p + 2;