1
0
forked from aniani/vim

patch 8.2.3633: Vim9: line number of lambda is off by one

Problem:    Vim9: line number of lambda is off by one.
Solution:   Add one to the line number. (closes #9083)
This commit is contained in:
Bram Moolenaar
2021-11-20 21:35:41 +00:00
parent 9cd9385db7
commit a755fdbe80
3 changed files with 17 additions and 1 deletions

View File

@@ -1052,6 +1052,20 @@ def Test_call_lambda_args()
CheckScriptFailure(['vim9script'] + lines, 'E118: Too many arguments for function: <lambda>', 2)
enddef
def Test_lambda_line_nr()
var lines =<< trim END
vim9script
# comment
# comment
var id = timer_start(1'000, (_) => 0)
var out = execute('verbose ' .. timer_info(id)[0].callback
->string()
->substitute("('\\|')", ' ', 'g'))
assert_match('Last set from .* line 4', out)
END
CheckScriptSuccess(lines)
enddef
def FilterWithCond(x: string, Cond: func(string): bool): bool
return Cond(x)
enddef