aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-01-06 06:58:37 +0800
committerzeertzjq <zeertzjq@outlook.com>2024-01-13 08:29:47 +0800
commit4142b8cd2c86fab27d041373dde78a1bc4fa9895 (patch)
tree0a8c3c2916cade2a57c162ef4b791b48bdb0d4e3
parentc8f696f2b0c289a88054c20e0415051ebe017eb3 (diff)
downloadrneovim-4142b8cd2c86fab27d041373dde78a1bc4fa9895.tar.gz
rneovim-4142b8cd2c86fab27d041373dde78a1bc4fa9895.tar.bz2
rneovim-4142b8cd2c86fab27d041373dde78a1bc4fa9895.zip
vim-patch:8.2.3439: deleted lines go to wrong yank register
Problem: Deleted lines go to wrong yank register. Solution: Reset y_append when not calling get_yank_register(). (Christian Brabandt, closes vim/vim#8872) https://github.com/vim/vim/commit/78eb9cce911dcd662182443e0920649ec1596d41 Nvim has removed y_append static variable and already works as expected. Co-authored-by: Christian Brabandt <cb@256bit.org>
-rw-r--r--test/old/testdir/test_registers.vim51
1 files changed, 51 insertions, 0 deletions
diff --git a/test/old/testdir/test_registers.vim b/test/old/testdir/test_registers.vim
index 0817c123a9..64dcc687ce 100644
--- a/test/old/testdir/test_registers.vim
+++ b/test/old/testdir/test_registers.vim
@@ -838,5 +838,56 @@ func Test_replay_charsearch_omap()
bwipe!
endfunc
+" Make sure that y_append is correctly reset
+" and the previous register is working as expected
+func Test_register_y_append_reset()
+ new
+ call setline(1, ['1',
+ \ '2 ----------------------------------------------------',
+ \ '3',
+ \ '4',
+ \ '5 ----------------------------------------------------',
+ \ '6',
+ \ '7',
+ \ '8 ----------------------------------------------------',
+ \ '9',
+ \ '10 aaaaaaa 4.',
+ \ '11 Game Dbl-Figures Leaders:',
+ \ '12 Player Pts FG% 3P% FT% RB AS BL ST TO PF EFF',
+ \ '13 bbbbbbbbb 12 (50 /0 /67 )/ 7/ 3/ 0/ 2/ 3/ 4/+15',
+ \ '14 cccccc 12 (57 /67 /100)/ 2/ 1/ 1/ 0/ 1/ 3/+12',
+ \ '15 ddddddd 10 (63 /0 /0 )/ 1/ 3/ 0/ 3/ 5/ 3/ +9',
+ \ '16 4 5-15 0-3 2-2 5-12 1-1 3-4 33.3 0.0 100 41.7 100 75 12 14',
+ \ '17 F 23-55 2-10 9-11 23-52 3-13 26-29 41.8 20 81.8 44.2 23.1 89.7 57 75',
+ \ '18 4 3 6 3 2 3 3 4 3 3 7 3 1 4 6 -1 -1 +2 -1 -2',
+ \ '19 F 13 19 5 10 4 17 22 9 14 32 13 4 20 17 -1 -13 -4 -3 -3 +5'])
+ 11
+ exe "norm! \"a5dd"
+ norm! j
+ exe "norm! \"bY"
+ norm! 2j
+ exe "norm! \"BY"
+ norm! 4k
+ norm! 5dd
+ norm! 3k
+ " The next put should put the content of the unnamed register, not of
+ " register b!
+ norm! p
+ call assert_equal(['1',
+ \ '2 ----------------------------------------------------',
+ \ '3',
+ \ '4',
+ \ '5 ----------------------------------------------------',
+ \ '6',
+ \ '10 aaaaaaa 4.',
+ \ '16 4 5-15 0-3 2-2 5-12 1-1 3-4 33.3 0.0 100 41.7 100 75 12 14',
+ \ '17 F 23-55 2-10 9-11 23-52 3-13 26-29 41.8 20 81.8 44.2 23.1 89.7 57 75',
+ \ '18 4 3 6 3 2 3 3 4 3 3 7 3 1 4 6 -1 -1 +2 -1 -2',
+ \ '19 F 13 19 5 10 4 17 22 9 14 32 13 4 20 17 -1 -13 -4 -3 -3 +5',
+ \ '7',
+ \ '8 ----------------------------------------------------',
+ \ '9'], getline(1,'$'))
+ bwipe!
+endfunc
" vim: shiftwidth=2 sts=2 expandtab