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:
parent
07ecfa64a1
commit
18d90b95c4
@ -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 */
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -764,6 +764,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
681,
|
||||
/**/
|
||||
680,
|
||||
/**/
|
||||
|
Loading…
x
Reference in New Issue
Block a user