mirror of
https://github.com/vim/vim.git
synced 2025-07-04 23:07:33 -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:
parent
53ba6ca5b2
commit
1b1df95f1a
@ -2849,6 +2849,7 @@ eval4(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
|
|||||||
int vim9script = in_vim9script();
|
int vim9script = in_vim9script();
|
||||||
int evaluate = evalarg == NULL
|
int evaluate = evalarg == NULL
|
||||||
? 0 : (evalarg->eval_flags & EVAL_EVALUATE);
|
? 0 : (evalarg->eval_flags & EVAL_EVALUATE);
|
||||||
|
long comp_lnum = SOURCING_LNUM;
|
||||||
|
|
||||||
if (getnext)
|
if (getnext)
|
||||||
{
|
{
|
||||||
@ -2904,6 +2905,8 @@ eval4(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
|
|||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
// use the line of the comparison for messages
|
||||||
|
SOURCING_LNUM = comp_lnum;
|
||||||
if (vim9script && check_compare_types(type, rettv, &var2) == FAIL)
|
if (vim9script && check_compare_types(type, rettv, &var2) == FAIL)
|
||||||
{
|
{
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
|
@ -844,6 +844,13 @@ def Test_expr4_compare_none()
|
|||||||
v9.CheckDefAndScriptFailure(['echo [] == v:none'], 'E1072: Cannot compare list with special')
|
v9.CheckDefAndScriptFailure(['echo [] == v:none'], 'E1072: Cannot compare list with special')
|
||||||
v9.CheckDefAndScriptFailure(['echo 123 == v:none'], 'E1072: Cannot compare number with special')
|
v9.CheckDefAndScriptFailure(['echo 123 == v:none'], 'E1072: Cannot compare number with special')
|
||||||
v9.CheckDefAndScriptFailure(['echo 0z00 == v:none'], 'E1072: Cannot compare blob with special')
|
v9.CheckDefAndScriptFailure(['echo 0z00 == v:none'], 'E1072: Cannot compare blob with special')
|
||||||
|
|
||||||
|
lines =<< trim END
|
||||||
|
echo [] == v:none
|
||||||
|
|
||||||
|
eval 0 + 0
|
||||||
|
END
|
||||||
|
v9.CheckDefAndScriptFailure(lines, 'E1072:', 1)
|
||||||
enddef
|
enddef
|
||||||
|
|
||||||
def Test_expr4_wrong_type()
|
def Test_expr4_wrong_type()
|
||||||
|
@ -750,6 +750,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
4540,
|
||||||
/**/
|
/**/
|
||||||
4539,
|
4539,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user