1
0
forked from aniani/vim

patch 8.2.2186: Vim9: error when using 'opfunc'

Problem:    Vim9: error when using 'opfunc'.
Solution:   Do not expect a return value from 'opfunc'. (closes #7510)
This commit is contained in:
Bram Moolenaar
2020-12-22 12:20:08 +01:00
parent c882e4d169
commit 5b3d1bb0f5
5 changed files with 39 additions and 5 deletions

View File

@@ -1976,5 +1976,20 @@ def Test_dict_member_with_silent()
CheckScriptSuccess(lines)
enddef
def Test_opfunc()
nnoremap <F3> <cmd>set opfunc=Opfunc<cr>g@
def g:Opfunc(_: any): string
setline(1, 'ASDF')
return ''
enddef
new
setline(1, 'asdf')
feedkeys("\<F3>$", 'x')
assert_equal('ASDF', getline(1))
bwipe!
nunmap <F3>
enddef
" vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker