From f923571ec17b6caeeb7f4abfd7eec3f707ab9c45 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 16 Aug 2020 18:42:53 +0200 Subject: patch 8.2.1468: Vim9: invalid error for missing white space Problem: Vim9: invalid error for missing white space. Solution: Don't skip over white space after index. (closes #6718) --- src/eval.c | 2 +- src/testdir/test_vim9_expr.vim | 7 +++++++ src/version.c | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/eval.c b/src/eval.c index 37ed5153e..3c4a8c562 100644 --- a/src/eval.c +++ b/src/eval.c @@ -3624,7 +3624,7 @@ eval_index( clear_tv(&var2); return FAIL; } - *arg = skipwhite(*arg + 1); // skip the ']' + *arg = *arg + 1; // skip over the ']' } if (evaluate) diff --git a/src/testdir/test_vim9_expr.vim b/src/testdir/test_vim9_expr.vim index 01ac3e615..ee68537e7 100644 --- a/src/testdir/test_vim9_expr.vim +++ b/src/testdir/test_vim9_expr.vim @@ -827,6 +827,13 @@ def Test_expr4_vim9script() echo len('xxx') == 3 END CheckScriptSuccess(lines) + + lines =<< trim END + vim9script + let line = 'abc' + echo line[1] =~ '\w' + END + CheckScriptSuccess(lines) enddef func Test_expr4_fails() diff --git a/src/version.c b/src/version.c index c8794ce92..19a870468 100644 --- a/src/version.c +++ b/src/version.c @@ -754,6 +754,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1468, /**/ 1467, /**/ -- cgit v1.2.1