aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-01-13 08:29:54 +0800
committerzeertzjq <zeertzjq@outlook.com>2024-01-13 08:31:01 +0800
commit64a50d08c4866011be73d6af0e8ae90e06c3f949 (patch)
tree49958ccc99d0dde40e37abaf1a8e0c4f31715112 /test
parent2783b6b0a48389f5e12109d9894269768c3e9fe5 (diff)
downloadrneovim-64a50d08c4866011be73d6af0e8ae90e06c3f949.tar.gz
rneovim-64a50d08c4866011be73d6af0e8ae90e06c3f949.tar.bz2
rneovim-64a50d08c4866011be73d6af0e8ae90e06c3f949.zip
vim-patch:9.1.0021: i_CTRL-R- doesn't work for multibyte chars in Replace mode
Problem: i_CTRL-R- doesn't work for multibyte chars in Replace mode, Coverity complains missing return value for u_save_cursor() Solution: Use mb_charlen() and del_chars() instead, handle failure mode for u_save_cursor() correctly (@zeertzjq) closes: vim/vim#13846 https://github.com/vim/vim/commit/424ec1f235a53131042aed94d30f6e2528e551d9
Diffstat (limited to 'test')
-rw-r--r--test/old/testdir/test_registers.vim16
1 files changed, 14 insertions, 2 deletions
diff --git a/test/old/testdir/test_registers.vim b/test/old/testdir/test_registers.vim
index 7cc5ebbe6f..bc90de806f 100644
--- a/test/old/testdir/test_registers.vim
+++ b/test/old/testdir/test_registers.vim
@@ -893,7 +893,7 @@ endfunc
func Test_insert_small_delete_replace_mode()
new
call setline(1, ['foo', 'bar', 'foobar', 'bar'])
- let @-='foo'
+ let @- = 'foo'
call cursor(2, 1)
exe ":norm! R\<C-R>-\<C-R>-"
call assert_equal('foofoo', getline(2))
@@ -904,9 +904,21 @@ func Test_insert_small_delete_replace_mode()
exe ":norm! R\<C-R>-ZZZZ"
call assert_equal(['foo', 'foofoo', '', 'bfoobarZZZZ'], getline(1, 4))
call cursor(1, 1)
- let @-=''
+ let @- = ''
exe ":norm! R\<C-R>-ZZZ"
call assert_equal(['ZZZ', 'foofoo', '', 'bfoobarZZZZ'], getline(1, 4))
+ let @- = 'βbβ'
+ call cursor(4, 1)
+ exe ":norm! R\<C-R>-"
+ call assert_equal(['ZZZ', 'foofoo', '', 'βbβobarZZZZ'], getline(1, 4))
+ let @- = 'bβb'
+ call cursor(4, 1)
+ exe ":norm! R\<C-R>-"
+ call assert_equal(['ZZZ', 'foofoo', '', 'bβbobarZZZZ'], getline(1, 4))
+ let @- = 'βbβ'
+ call cursor(4, 1)
+ exe ":norm! R\<C-R>-"
+ call assert_equal(['ZZZ', 'foofoo', '', 'βbβobarZZZZ'], getline(1, 4))
bwipe!
endfunc