aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2025-03-18 06:07:13 +0800
committerzeertzjq <zeertzjq@outlook.com>2025-03-18 06:12:40 +0800
commitd717f8605a05dad4c050ac1e0731c7aba572fe59 (patch)
tree8f065387ba252cc85633847ddbc9eced28e0dd01 /test
parent59d8d50c5bbcfb9215eddc0f4314fdd1cce55422 (diff)
downloadrneovim-d717f8605a05dad4c050ac1e0731c7aba572fe59.tar.gz
rneovim-d717f8605a05dad4c050ac1e0731c7aba572fe59.tar.bz2
rneovim-d717f8605a05dad4c050ac1e0731c7aba572fe59.zip
vim-patch:9.1.1216: Pasting the '.' register multiple times may not work
Problem: Pasting the '.' register multiple times may work incorrectly when the last insert starts with Ctrl-D and ends with '0'. (after 9.1.1212) Solution: Restore the missing assignment (zeertzjq). closes: vim/vim#16908 https://github.com/vim/vim/commit/61b354442418539056cc7073a9aec353d297836c
Diffstat (limited to 'test')
-rw-r--r--test/old/testdir/test_put.vim27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/old/testdir/test_put.vim b/test/old/testdir/test_put.vim
index 6b332faaeb..e0a78c7409 100644
--- a/test/old/testdir/test_put.vim
+++ b/test/old/testdir/test_put.vim
@@ -328,4 +328,31 @@ func Test_put_list()
bw!
endfunc
+" Test pasting the '.' register
+func Test_put_inserted()
+ new
+
+ for s in ['', '…', '0', '^', '+0', '+^', '…0', '…^']
+ call setline(1, 'foobar')
+ exe $"normal! A{s}\<Esc>"
+ call assert_equal($'foobar{s}', getline(1))
+ normal! ".p
+ call assert_equal($'foobar{s}{s}', getline(1))
+ normal! ".2p
+ call assert_equal($'foobar{s}{s}{s}{s}', getline(1))
+ endfor
+
+ for s in ['0', '^', '+0', '+^', '…0', '…^']
+ call setline(1, "\t\t\t\t\tfoobar")
+ exe $"normal! A\<C-D>{s}\<Esc>"
+ call assert_equal($"\t\t\t\tfoobar{s}", getline(1))
+ normal! ".p
+ call assert_equal($"\t\t\tfoobar{s}{s}", getline(1))
+ normal! ".2p
+ call assert_equal($"\tfoobar{s}{s}{s}{s}", getline(1))
+ endfor
+
+ bwipe!
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab