mirror of
https://github.com/neovim/neovim.git
synced 2024-12-24 13:15:09 -07:00
vim-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)
18d90b95c4
This commit is contained in:
parent
35362495c9
commit
8843928e10
@ -1408,7 +1408,9 @@ int op_delete(oparg_T *oap)
|
||||
free_register(&y_regs[9]); /* free register "9 */
|
||||
for (n = 9; n > 1; n--)
|
||||
y_regs[n] = y_regs[n - 1];
|
||||
y_previous = &y_regs[1];
|
||||
if (!is_append_register(oap->regname)) {
|
||||
y_previous = &y_regs[1];
|
||||
}
|
||||
y_regs[1].y_array = NULL; /* set register "1 to empty */
|
||||
reg = &y_regs[1];
|
||||
op_yank_reg(oap, false, reg, false);
|
||||
|
@ -47,3 +47,14 @@ func Test_put_expr()
|
||||
call assert_equal(['A1','A2','A3','4A','5A','6A'], getline(1,'$'))
|
||||
bw!
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user