forked from aniani/vim
patch 9.0.0056: wrong line number reported when :cexpr fails in :def function
Problem: Wrong line number reported when :cexpr fails in :def function. Solution: Set line_number before executing :cexpr. (closes #10735)
This commit is contained in:
parent
fa49eb4827
commit
bd683e3a79
@ -4205,6 +4205,18 @@ def Test_multiple_funcref()
|
|||||||
v9.CheckScriptSuccess(lines)
|
v9.CheckScriptSuccess(lines)
|
||||||
enddef
|
enddef
|
||||||
|
|
||||||
|
def Test_cexpr_errmsg_line_number()
|
||||||
|
var lines =<< trim END
|
||||||
|
vim9script
|
||||||
|
def Func()
|
||||||
|
var qfl = {}
|
||||||
|
cexpr qfl
|
||||||
|
enddef
|
||||||
|
Func()
|
||||||
|
END
|
||||||
|
v9.CheckScriptFailure(lines, 'E777', 2)
|
||||||
|
enddef
|
||||||
|
|
||||||
" The following messes up syntax highlight, keep near the end.
|
" The following messes up syntax highlight, keep near the end.
|
||||||
if has('python3')
|
if has('python3')
|
||||||
def Test_python3_command()
|
def Test_python3_command()
|
||||||
|
@ -735,6 +735,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 */
|
||||||
|
/**/
|
||||||
|
56,
|
||||||
/**/
|
/**/
|
||||||
55,
|
55,
|
||||||
/**/
|
/**/
|
||||||
|
@ -2786,6 +2786,7 @@ exec_instructions(ectx_T *ectx)
|
|||||||
ea.cmdlinep = &iptr->isn_arg.cexpr.cexpr_ref->cer_cmdline;
|
ea.cmdlinep = &iptr->isn_arg.cexpr.cexpr_ref->cer_cmdline;
|
||||||
--ectx->ec_stack.ga_len;
|
--ectx->ec_stack.ga_len;
|
||||||
tv = STACK_TV_BOT(0);
|
tv = STACK_TV_BOT(0);
|
||||||
|
SOURCING_LNUM = iptr->isn_lnum;
|
||||||
res = cexpr_core(&ea, tv);
|
res = cexpr_core(&ea, tv);
|
||||||
clear_tv(tv);
|
clear_tv(tv);
|
||||||
if (res == FAIL)
|
if (res == FAIL)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user