comparison 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
comparison
equal deleted inserted replaced
26225:b0c79beaf975 26226:9a8e9383e4cd
361 " clean up 361 " clean up
362 setl nofoldenable fdm=marker 362 setl nofoldenable fdm=marker
363 bw! 363 bw!
364 endfunc 364 endfunc
365 365
366 func Test_normal09_operatorfunc() 366 func Test_normal09a_operatorfunc()
367 " Test operatorfunc 367 " Test operatorfunc
368 call Setup_NewWindow() 368 call Setup_NewWindow()
369 " Add some spaces for counting 369 " Add some spaces for counting
370 50,60s/$/ / 370 50,60s/$/ /
371 unlet! g:a 371 unlet! g:a
455 set opfunc= 455 set opfunc=
456 unlet! g:a 456 unlet! g:a
457 bw! 457 bw!
458 endfunc 458 endfunc
459 459
460 func Test_normal09a_operatorfunc() 460 func Test_normal09b_operatorfunc()
461 " Test operatorfunc 461 " Test operatorfunc
462 call Setup_NewWindow() 462 call Setup_NewWindow()
463 " Add some spaces for counting 463 " Add some spaces for counting
464 50,60s/$/ / 464 50,60s/$/ /
465 unlet! g:opt 465 unlet! g:opt
480 unmap <buffer> ,, 480 unmap <buffer> ,,
481 set opfunc= 481 set opfunc=
482 call assert_fails('normal Vg@', 'E774:') 482 call assert_fails('normal Vg@', 'E774:')
483 bw! 483 bw!
484 unlet! g:opt 484 unlet! g:opt
485 endfunc
486
487 func OperatorfuncRedo(_)
488 let g:opfunc_count = v:count
489 endfunc
490
491 func Test_normal09c_operatorfunc()
492 " Test redoing operatorfunc
493 new
494 call setline(1, 'some text')
495 set operatorfunc=OperatorfuncRedo
496 normal v3g@
497 call assert_equal(3, g:opfunc_count)
498 let g:opfunc_count = 0
499 normal .
500 call assert_equal(3, g:opfunc_count)
501
502 bw!
503 unlet g:opfunc_count
504 set operatorfunc=
485 endfunc 505 endfunc
486 506
487 func Test_normal10_expand() 507 func Test_normal10_expand()
488 " Test for expand() 508 " Test for expand()
489 10new 509 10new