mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 8.2.1656: Vim9: callstack wrong if :def function calls :def function
Problem: Vim9: callstack wrong if :def function calls :def function. Solution: Set the line number before calling. (closes #6914)
This commit is contained in:
parent
895a7a472d
commit
dfa3d5524e
@ -1776,5 +1776,25 @@ def Test_restore_modifiers()
|
|||||||
assert_equal('', g:ei_after)
|
assert_equal('', g:ei_after)
|
||||||
enddef
|
enddef
|
||||||
|
|
||||||
|
def StackTop()
|
||||||
|
eval 1
|
||||||
|
eval 2
|
||||||
|
# call not on fourth line
|
||||||
|
StackBot()
|
||||||
|
enddef
|
||||||
|
|
||||||
|
def StackBot()
|
||||||
|
# throw an error
|
||||||
|
eval [][0]
|
||||||
|
enddef
|
||||||
|
|
||||||
|
def Test_callstack_def()
|
||||||
|
try
|
||||||
|
StackTop()
|
||||||
|
catch
|
||||||
|
assert_match('Test_callstack_def\[2\]..StackTop\[4\]..StackBot, line 2', v:throwpoint)
|
||||||
|
endtry
|
||||||
|
enddef
|
||||||
|
|
||||||
|
|
||||||
" vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker
|
" vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker
|
||||||
|
@ -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 */
|
||||||
|
/**/
|
||||||
|
1656,
|
||||||
/**/
|
/**/
|
||||||
1655,
|
1655,
|
||||||
/**/
|
/**/
|
||||||
|
@ -1665,6 +1665,7 @@ call_def_function(
|
|||||||
|
|
||||||
// call a :def function
|
// call a :def function
|
||||||
case ISN_DCALL:
|
case ISN_DCALL:
|
||||||
|
SOURCING_LNUM = iptr->isn_lnum;
|
||||||
if (call_dfunc(iptr->isn_arg.dfunc.cdf_idx,
|
if (call_dfunc(iptr->isn_arg.dfunc.cdf_idx,
|
||||||
iptr->isn_arg.dfunc.cdf_argcount,
|
iptr->isn_arg.dfunc.cdf_argcount,
|
||||||
&ectx) == FAIL)
|
&ectx) == FAIL)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user