diff src/testdir/test_normal.vim @ 26226:9a8e9383e4cd v8.2.3644

patch 8.2.3644: count for 'operatorfunc' in Visual mode is not redone Commit: https://github.com/vim/vim/commit/2228cd72cf7c6f326e4e41179e88d37595ca4abc Author: Bram Moolenaar <Bram@vim.org> Date: Mon Nov 22 14:16:08 2021 +0000 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 https://github.com/vim/vim/issues/9174)
author Bram Moolenaar <Bram@vim.org>
date Mon, 22 Nov 2021 15:30:08 +0100
parents 485c7c4afeb7
children 92fbed13ca4d
line wrap: on
line diff
--- a/src/testdir/test_normal.vim
+++ b/src/testdir/test_normal.vim
@@ -363,7 +363,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
@@ -457,7 +457,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
@@ -484,6 +484,26 @@ func Test_normal09a_operatorfunc()
   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