Permalink
Browse files

patch 8.0.0681: unnamed register only contains the last deleted text

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)
  • Loading branch information...
brammool committed Jun 27, 2017
1 parent 07ecfa6 commit 18d90b95c49d9ff1c635dd762864022aab8e71f1
Showing with 16 additions and 1 deletion.
  1. +3 −1 src/ops.c
  2. +11 −0 src/testdir/test_put.vim
  3. +2 −0 src/version.c
View
@@ -1636,7 +1636,9 @@ shift_delete_registers()
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_current = &y_regs[1];
if (!y_append)
y_previous = y_current;
y_regs[1].y_array = NULL; /* set register one to empty */
}
View
@@ -34,3 +34,14 @@ func Test_put_char_block2()
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
View
@@ -764,6 +764,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
681,
/**/
680,
/**/

0 comments on commit 18d90b9

Please sign in to comment.