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 #9174)
diff --git a/src/testdir/test_normal.vim b/src/testdir/test_normal.vim
index fd2e2ec..e17aca4 100644
--- a/src/testdir/test_normal.vim
+++ b/src/testdir/test_normal.vim
@@ -363,7 +363,7 @@
bw!
endfunc
-func Test_normal09_operatorfunc()
+func Test_normal09a_operatorfunc()
" Test operatorfunc
call Setup_NewWindow()
" Add some spaces for counting
@@ -457,7 +457,7 @@
bw!
endfunc
-func Test_normal09a_operatorfunc()
+func Test_normal09b_operatorfunc()
" Test operatorfunc
call Setup_NewWindow()
" Add some spaces for counting
@@ -484,6 +484,26 @@
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