vim-patch:8.1.0022: repeating put from expression register fails

Problem:    Repeating put from expression register fails.
Solution:   Re-evaluate the expression register. (Andy Massimino,
            closes vim/vim#2945)
833093bfb0
This commit is contained in:
Jan Edmund Lazo 2018-08-29 00:06:37 -04:00
parent 461d46d8ac
commit 7c38f60b3b
2 changed files with 20 additions and 0 deletions

View File

@ -755,6 +755,13 @@ int start_redo(long count, int old_redo)
if (c >= '1' && c < '9')
++c;
add_char_buff(&readbuf2, c);
// the expression register should be re-evaluated
if (c == '=') {
add_char_buff(&readbuf2, CAR);
cmd_silent = true;
}
c = read_redo(FALSE, old_redo);
}

View File

@ -34,3 +34,16 @@ func Test_put_char_block2()
bw!
call setreg('a', a[0], a[1])
endfunc
func Test_put_expr()
new
call setline(1, repeat(['A'], 6))
exec "1norm! \"=line('.')\<cr>p"
norm! j0.
norm! j0.
exec "4norm! \"=\<cr>P"
norm! j0.
norm! j0.
call assert_equal(['A1','A2','A3','4A','5A','6A'], getline(1,'$'))
bw!
endfunc