summaryrefslogtreecommitdiff
path: root/src/testdir
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-12-22 12:20:08 +0100
committerBram Moolenaar <Bram@vim.org>2020-12-22 12:20:08 +0100
commit5b3d1bb0f5180266c4de4d815b3ea856a2fb3519 (patch)
tree2effbeb3391d960098a300e47d0c2a7d17100fff /src/testdir
parentc882e4d169fd5e0364bc91642040337efe7327a6 (diff)
downloadvim-git-5b3d1bb0f5180266c4de4d815b3ea856a2fb3519.tar.gz
patch 8.2.2186: Vim9: error when using 'opfunc'v8.2.2186
Problem: Vim9: error when using 'opfunc'. Solution: Do not expect a return value from 'opfunc'. (closes #7510)
Diffstat (limited to 'src/testdir')
-rw-r--r--src/testdir/test_vim9_func.vim15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/testdir/test_vim9_func.vim b/src/testdir/test_vim9_func.vim
index 4a0c7a90c..fcfe41f2f 100644
--- 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