0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

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)
This commit is contained in:
Bram Moolenaar 2017-06-27 15:39:14 +02:00
parent 07ecfa64a1
commit 18d90b95c4
3 changed files with 16 additions and 1 deletions

View File

@ -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 File

@ -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 File

@ -764,6 +764,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
681,
/**/
680,
/**/