comparison 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
comparison
equal deleted inserted replaced
23280:a6d48e6961aa 23281:5b4db8035d1d
1974 unlet g:result 1974 unlet g:result
1975 END 1975 END
1976 CheckScriptSuccess(lines) 1976 CheckScriptSuccess(lines)
1977 enddef 1977 enddef
1978 1978
1979 def Test_opfunc()
1980 nnoremap <F3> <cmd>set opfunc=Opfunc<cr>g@
1981 def g:Opfunc(_: any): string
1982 setline(1, 'ASDF')
1983 return ''
1984 enddef
1985 new
1986 setline(1, 'asdf')
1987 feedkeys("\<F3>$", 'x')
1988 assert_equal('ASDF', getline(1))
1989
1990 bwipe!
1991 nunmap <F3>
1992 enddef
1993
1979 1994
1980 " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker 1995 " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker