summaryrefslogtreecommitdiffstats
path: root/src/eval.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-03-10 20:01:50 +0000
committerBram Moolenaar <Bram@vim.org>2022-03-10 20:01:50 +0000
commit1b1df95f1a84cbc362e32f676f1e135aa2e7fc3c (patch)
treeb22a46b8f7b9e2668aadb1ba035a7fffa82091de /src/eval.c
parent53ba6ca5b27248680e368340707ad4b32a82591f (diff)
patch 8.2.4540: line number for error is off by onev8.2.4540
Problem: Line number for error is off by one. Solution: Remember the line number of the comparison. (closes #9923)
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/eval.c b/src/eval.c
index a48b8f8abb..1d57c38aa0 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -2849,6 +2849,7 @@ eval4(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
int vim9script = in_vim9script();
int evaluate = evalarg == NULL
? 0 : (evalarg->eval_flags & EVAL_EVALUATE);
+ long comp_lnum = SOURCING_LNUM;
if (getnext)
{
@@ -2904,6 +2905,8 @@ eval4(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
{
int ret;
+ // use the line of the comparison for messages
+ SOURCING_LNUM = comp_lnum;
if (vim9script && check_compare_types(type, rettv, &var2) == FAIL)
{
ret = FAIL;