diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-01-09 13:36:28 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-01-09 13:36:28 +0000 |
commit | 5f25c3855071bd7e26255c68bf458b1b5cf92f39 (patch) | |
tree | 7c5185450e9ab3f28dcbb80a6fb6735eac736980 | |
parent | c14f667626ba677a767d474324306e39096dc43e (diff) | |
download | vim-git-5f25c3855071bd7e26255c68bf458b1b5cf92f39.tar.gz |
patch 8.2.4049: Vim9: reading before the start of the line with "$"v8.2.4049
Problem: Vim9: reading before the start of the line with "$" by itself.
Solution: Do not subtract one when reporting the error.
-rw-r--r-- | src/testdir/test_vim9_expr.vim | 1 | ||||
-rw-r--r-- | src/version.c | 2 | ||||
-rw-r--r-- | src/vim9expr.c | 2 |
3 files changed, 4 insertions, 1 deletions
diff --git a/src/testdir/test_vim9_expr.vim b/src/testdir/test_vim9_expr.vim index 01b453850..52237e33f 100644 --- a/src/testdir/test_vim9_expr.vim +++ b/src/testdir/test_vim9_expr.vim @@ -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() diff --git a/src/version.c b/src/version.c index be49f09e2..cf0665c02 100644 --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 4049, +/**/ 4048, /**/ 4047, diff --git a/src/vim9expr.c b/src/vim9expr.c index 83c68a9ff..edaee5099 100644 --- a/src/vim9expr.c +++ b/src/vim9expr.c @@ -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; } |