summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_put.vim
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 07:39:41 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 07:39:41 +0000
commit00c068502d170f9f9b59c4a68aa12e8835859f6c (patch)
tree2047fc01b8c70326d9b87b47a575e7e5f2141b62 /src/testdir/test_put.vim
parentAdding upstream version 2:9.1.0016. (diff)
downloadvim-00c068502d170f9f9b59c4a68aa12e8835859f6c.tar.xz
vim-00c068502d170f9f9b59c4a68aa12e8835859f6c.zip
Adding upstream version 2:9.1.0199.upstream/2%9.1.0199
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/testdir/test_put.vim')
-rw-r--r--src/testdir/test_put.vim38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/testdir/test_put.vim b/src/testdir/test_put.vim
index 72479ac..5b5c354 100644
--- a/src/testdir/test_put.vim
+++ b/src/testdir/test_put.vim
@@ -12,6 +12,16 @@ func Test_put_block()
bwipe!
endfunc
+func Test_put_block_unicode()
+ new
+ call setreg('a', "À\nÀÀ\naaaaaaaaaaaa", "\<C-V>")
+ call setline(1, [' 1', ' 2', ' 3'])
+ exe "norm! \<C-V>jj\"ap"
+ let expected = ['À 1', 'ÀÀ 2', 'aaaaaaaaaaaa3']
+ call assert_equal(expected, getline(1, 3))
+ bw!
+endfunc
+
func Test_put_char_block()
new
call setline(1, ['Line 1', 'Line 2'])
@@ -280,5 +290,33 @@ func Test_put_in_last_displayed_line()
call StopVimInTerminal(buf)
endfunc
+func Test_put_visual_replace_whole_fold()
+ new
+ let lines = repeat(['{{{1', 'foo', 'bar', ''], 2)
+ call setline(1, lines)
+ setlocal foldmethod=marker
+ call setreg('"', 'baz')
+ call setreg('1', '')
+ normal! Vp
+ call assert_equal("{{{1\nfoo\nbar\n\n", getreg('1'))
+ call assert_equal(['baz', '{{{1', 'foo', 'bar', ''], getline(1, '$'))
+
+ bwipe!
+endfunc
+
+func Test_put_visual_replace_fold_marker()
+ new
+ let lines = repeat(['{{{1', 'foo', 'bar', ''], 4)
+ call setline(1, lines)
+ setlocal foldmethod=marker
+ normal! Gkzo
+ call setreg('"', '{{{1')
+ call setreg('1', '')
+ normal! Vp
+ call assert_equal("{{{1\n", getreg('1'))
+ call assert_equal(lines, getline(1, '$'))
+
+ bwipe!
+endfunc
" vim: shiftwidth=2 sts=2 expandtab