mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.2.4540: line number for error is off by one
Problem: Line number for error is off by one. Solution: Remember the line number of the comparison. (closes #9923)
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user