# HG changeset patch # User Bram Moolenaar # Date 1597596303 -7200 # Node ID 2b941fbab4d9458d05c1a8b1289eff1fd4f7bc33 # Parent dbcd219eed22af83aa5c6bbc69d24365fc6b2f77 patch 8.2.1468: Vim9: invalid error for missing white space Commit: https://github.com/vim/vim/commit/f923571ec17b6caeeb7f4abfd7eec3f707ab9c45 Author: Bram Moolenaar Date: Sun Aug 16 18:42:53 2020 +0200 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 https://github.com/vim/vim/issues/6718) diff --git a/src/eval.c b/src/eval.c --- 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 --- 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 --- a/src/version.c +++ b/src/version.c @@ -755,6 +755,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1468, +/**/ 1467, /**/ 1466,