aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-07-05 16:40:01 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-07-05 17:32:42 +0800
commitdd5fce2f5df9d49fe9ca878190471ac6697b636c (patch)
treeb53844bb30503c63fe1ac3c9017ea01db092bd4d /src/nvim/testdir
parentf42657cbcf0e5775692b57e25591d42844a81934 (diff)
downloadrneovim-dd5fce2f5df9d49fe9ca878190471ac6697b636c.tar.gz
rneovim-dd5fce2f5df9d49fe9ca878190471ac6697b636c.tar.bz2
rneovim-dd5fce2f5df9d49fe9ca878190471ac6697b636c.zip
vim-patch:8.2.3644: count for 'operatorfunc' in Visual mode is not redone
Problem: Count for 'operatorfunc' in Visual mode is not redone. Solution: Add the count to the redo buffer. (closes vim/vim#9174) https://github.com/vim/vim/commit/2228cd72cf7c6f326e4e41179e88d37595ca4abc Cherry-pick a line from patch 8.2.0522.
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_normal.vim25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/nvim/testdir/test_normal.vim b/src/nvim/testdir/test_normal.vim
index 9e7db91f25..653e37f2d1 100644
--- a/src/nvim/testdir/test_normal.vim
+++ b/src/nvim/testdir/test_normal.vim
@@ -345,7 +345,7 @@ func Test_normal08_fold()
bw!
endfunc
-func Test_normal09_operatorfunc()
+func Test_normal09a_operatorfunc()
" Test operatorfunc
call Setup_NewWindow()
" Add some spaces for counting
@@ -375,7 +375,7 @@ func Test_normal09_operatorfunc()
bw!
endfunc
-func Test_normal09a_operatorfunc()
+func Test_normal09b_operatorfunc()
" Test operatorfunc
call Setup_NewWindow()
" Add some spaces for counting
@@ -397,10 +397,31 @@ func Test_normal09a_operatorfunc()
" clean up
unmap <buffer> ,,
set opfunc=
+ call assert_fails('normal Vg@', 'E774:')
bw!
unlet! g:opt
endfunc
+func OperatorfuncRedo(_)
+ let g:opfunc_count = v:count
+endfunc
+
+func Test_normal09c_operatorfunc()
+ " Test redoing operatorfunc
+ new
+ call setline(1, 'some text')
+ set operatorfunc=OperatorfuncRedo
+ normal v3g@
+ call assert_equal(3, g:opfunc_count)
+ let g:opfunc_count = 0
+ normal .
+ call assert_equal(3, g:opfunc_count)
+
+ bw!
+ unlet g:opfunc_count
+ set operatorfunc=
+endfunc
+
func Test_normal10_expand()
" Test for expand()
10new