Mercurial > vim
diff src/testdir/test_vim9_func.vim @ 23281:5b4db8035d1d v8.2.2186
patch 8.2.2186: Vim9: error when using 'opfunc'
Commit: https://github.com/vim/vim/commit/5b3d1bb0f5180266c4de4d815b3ea856a2fb3519
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Dec 22 12:20:08 2020 +0100
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 https://github.com/vim/vim/issues/7510)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 22 Dec 2020 12:30:04 +0100 |
parents | 35583da6397e |
children | 112fa621b127 |
line wrap: on
line diff
--- a/src/testdir/test_vim9_func.vim +++ b/src/testdir/test_vim9_func.vim @@ -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