Mercurial > vim
comparison src/testdir/test_vim9_func.vim @ 26203:a968027f8a2c v8.2.3633
patch 8.2.3633: Vim9: line number of lambda is off by one
Commit: https://github.com/vim/vim/commit/a755fdbe80bed4897e06028f0044c208e0f9d8cb
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Nov 20 21:35:41 2021 +0000
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 https://github.com/vim/vim/issues/9083)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 20 Nov 2021 22:45:03 +0100 |
parents | e861c5aaedd8 |
children | 9e5e331828da |
comparison
equal
deleted
inserted
replaced
26202:72829db3aeaa | 26203:a968027f8a2c |
---|---|
1048 lines =<< trim END | 1048 lines =<< trim END |
1049 echo 'aa'->((a) => a)('bb') | 1049 echo 'aa'->((a) => a)('bb') |
1050 END | 1050 END |
1051 CheckDefFailure(lines, 'E118: Too many arguments for function: ->((a) => a)(''bb'')', 1) | 1051 CheckDefFailure(lines, 'E118: Too many arguments for function: ->((a) => a)(''bb'')', 1) |
1052 CheckScriptFailure(['vim9script'] + lines, 'E118: Too many arguments for function: <lambda>', 2) | 1052 CheckScriptFailure(['vim9script'] + lines, 'E118: Too many arguments for function: <lambda>', 2) |
1053 enddef | |
1054 | |
1055 def Test_lambda_line_nr() | |
1056 var lines =<< trim END | |
1057 vim9script | |
1058 # comment | |
1059 # comment | |
1060 var id = timer_start(1'000, (_) => 0) | |
1061 var out = execute('verbose ' .. timer_info(id)[0].callback | |
1062 ->string() | |
1063 ->substitute("('\\|')", ' ', 'g')) | |
1064 assert_match('Last set from .* line 4', out) | |
1065 END | |
1066 CheckScriptSuccess(lines) | |
1053 enddef | 1067 enddef |
1054 | 1068 |
1055 def FilterWithCond(x: string, Cond: func(string): bool): bool | 1069 def FilterWithCond(x: string, Cond: func(string): bool): bool |
1056 return Cond(x) | 1070 return Cond(x) |
1057 enddef | 1071 enddef |