diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-07-05 16:56:26 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-07-05 17:32:42 +0800 |
commit | 5fcf701ba15d1ab4d7a46efaee01bcc52807fae2 (patch) | |
tree | 703661696d23a2c44578405c6285ed358339b7b4 /src/nvim/testdir | |
parent | dd5fce2f5df9d49fe9ca878190471ac6697b636c (diff) | |
download | rneovim-5fcf701ba15d1ab4d7a46efaee01bcc52807fae2.tar.gz rneovim-5fcf701ba15d1ab4d7a46efaee01bcc52807fae2.tar.bz2 rneovim-5fcf701ba15d1ab4d7a46efaee01bcc52807fae2.zip |
vim-patch:8.2.3980: if 'operatorfunc' invokes an operator Visual mode is changed
Problem: If 'operatorfunc' invokes an operator the remembered Visual mode
may be changed. (Naohiro Ono)
Solution: Save and restore the information for redoing the Visual area.
(closes vim/vim#9455)
https://github.com/vim/vim/commit/b3bd1d39e68e2d697c014b9f85482c2c12a3f909
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r-- | src/nvim/testdir/test_normal.vim | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_normal.vim b/src/nvim/testdir/test_normal.vim index 653e37f2d1..edd6e408bd 100644 --- a/src/nvim/testdir/test_normal.vim +++ b/src/nvim/testdir/test_normal.vim @@ -406,6 +406,10 @@ func OperatorfuncRedo(_) let g:opfunc_count = v:count endfunc +func Underscorize(_) + normal! '[V']r_ +endfunc + func Test_normal09c_operatorfunc() " Test redoing operatorfunc new @@ -419,6 +423,16 @@ func Test_normal09c_operatorfunc() bw! unlet g:opfunc_count + + " Test redoing Visual mode + set operatorfunc=Underscorize + new + call setline(1, ['first', 'first', 'third', 'third', 'second']) + normal! 1GVjr_ + normal! 5G. + normal! 3G. + call assert_equal(['_____', '_____', '_____', '_____', '______'], getline(1, '$')) + bwipe! set operatorfunc= endfunc |