From 7c38f60b3babe332de2b61fa829e0ea6ba27fb3a Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Wed, 29 Aug 2018 00:06:37 -0400 Subject: 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) https://github.com/vim/vim/commit/833093bfb0e4a7f89b5adc66babcfa8ac09cfda9 --- src/nvim/getchar.c | 7 +++++++ src/nvim/testdir/test_put.vim | 13 +++++++++++++ 2 files changed, 20 insertions(+) (limited to 'src') 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('.')\p" + norm! j0. + norm! j0. + exec "4norm! \"=\P" + norm! j0. + norm! j0. + call assert_equal(['A1','A2','A3','4A','5A','6A'], getline(1,'$')) + bw! +endfunc -- cgit