]> granicus.if.org Git - vim/commitdiff
patch 8.2.4049: Vim9: reading before the start of the line with "$" v8.2.4049
authorBram Moolenaar <Bram@vim.org>
Sun, 9 Jan 2022 13:36:28 +0000 (13:36 +0000)
committerBram Moolenaar <Bram@vim.org>
Sun, 9 Jan 2022 13:36:28 +0000 (13:36 +0000)
Problem:    Vim9: reading before the start of the line with "$" by itself.
Solution:   Do not subtract one when reporting the error.

src/testdir/test_vim9_expr.vim
src/version.c
src/vim9expr.c

index 01b45385084e5e130c07f67895e7b8fbe561193f..52237e33fdfe8a43fa8078870df8ed49903fc8fd 100644 (file)
@@ -2853,6 +2853,7 @@ def Test_expr7_environment()
   CheckDefAndScriptSuccess(lines)
 
   CheckDefAndScriptFailure(["var x = $$$"], ['E1002:', 'E15:'], 1)
+  CheckDefAndScriptFailure(["$"], ['E1002:', 'E15:'], 1)
 enddef
 
 def Test_expr7_register()
index be49f09e2b500fed7d71d5d67609594a20e37783..cf0665c02ce5b6de06902260255bfc408bcaf7a9 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4049,
 /**/
     4048,
 /**/
index 83c68a9ffa283b675969a3cbc0cb2133d7409adc..edaee509976af7b9b068f1c75532cda60c038a5c 100644 (file)
@@ -1233,7 +1233,7 @@ compile_get_env(char_u **arg, cctx_T *cctx)
     len = get_env_len(arg);
     if (len == 0)
     {
-       semsg(_(e_syntax_error_at_str), start - 1);
+       semsg(_(e_syntax_error_at_str), start);
        return FAIL;
     }