diff options
-rw-r--r-- | src/nvim/getchar.c | 7 | ||||
-rw-r--r-- | src/nvim/testdir/test_put.vim | 13 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index 0379b1cadb..8dae82d137 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -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); } diff --git a/src/nvim/testdir/test_put.vim b/src/nvim/testdir/test_put.vim index 38c812bc9c..0b8961c52b 100644 --- a/src/nvim/testdir/test_put.vim +++ b/src/nvim/testdir/test_put.vim @@ -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 |