Patch 8.0.0681
Problem: Unnamed register only contains the last deleted text when
appending deleted text to a register. (Wolfgang Jeltsch)
Solution: Only set y_previous when not using y_append. (Christian Brabandt)
Files: src/ops.c, src/testdir/test_put.vim
*** ../vim-8.0.0680/src/ops.c 2017-03-29 19:20:25.385015086 +0200
--- src/ops.c 2017-06-27 15:22:24.088971242 +0200
***************
*** 1636,1642 ****
free_yank_all(); /* free register nine */
for (n = 9; n > 1; --n)
y_regs[n] = y_regs[n - 1];
! y_previous = y_current = &y_regs[1];
y_regs[1].y_array = NULL; /* set register one to empty */
}
--- 1636,1644 ----
free_yank_all(); /* free register nine */
for (n = 9; n > 1; --n)
y_regs[n] = y_regs[n - 1];
! y_current = &y_regs[1];
! if (!y_append)
! y_previous = y_current;
y_regs[1].y_array = NULL; /* set register one to empty */
}
*** ../vim-8.0.0680/src/testdir/test_put.vim 2017-01-24 19:55:39.247204591
+0100
--- src/testdir/test_put.vim 2017-06-27 15:22:24.088971242 +0200
***************
*** 34,36 ****
--- 34,47 ----
bw!
call setreg('a', a[0], a[1])
endfunc
+
+ func Test_put_lines()
+ new
+ let a = [ getreg('a'), getregtype('a') ]
+ call setline(1, ['Line 1', 'Line2', 'Line 3', ''])
+ exe 'norm! gg"add"AddG""p'
+ call assert_equal(['Line 3', '', 'Line 1', 'Line2'], getline(1,'$'))
+ " clean up
+ bw!
+ call setreg('a', a[0], a[1])
+ endfunc
*** ../vim-8.0.0680/src/version.c 2017-06-27 14:43:51.203020467 +0200
--- src/version.c 2017-06-27 15:24:16.928092339 +0200
***************
*** 766,767 ****
--- 766,769 ----
{ /* Add new patch number below this line */
+ /**/
+ 681,
/**/
--
The sooner you fall behind, the more time you'll have to catch up.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.