changeset 21837:2b941fbab4d9 v8.2.1468

patch 8.2.1468: Vim9: invalid error for missing white space Commit: https://github.com/vim/vim/commit/f923571ec17b6caeeb7f4abfd7eec3f707ab9c45 Author: Bram Moolenaar <Bram@vim.org> 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)
author Bram Moolenaar <Bram@vim.org>
date Sun, 16 Aug 2020 18:45:03 +0200
parents dbcd219eed22
children 3e44fb527472
files src/eval.c src/testdir/test_vim9_expr.vim src/version.c
diffstat 3 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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)
--- 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()
--- 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,