aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Edmund Lazo <janedmundlazo@hotmail.com>2018-08-29 00:06:37 -0400
committerJan Edmund Lazo <janedmundlazo@hotmail.com>2018-08-29 00:08:15 -0400
commit7c38f60b3babe332de2b61fa829e0ea6ba27fb3a (patch)
treeb33e69f82e12ec922553a205000723c48889d133
parent461d46d8ace1b6950bf2733de9cb2b290453d86d (diff)
downloadrneovim-7c38f60b3babe332de2b61fa829e0ea6ba27fb3a.tar.gz
rneovim-7c38f60b3babe332de2b61fa829e0ea6ba27fb3a.tar.bz2
rneovim-7c38f60b3babe332de2b61fa829e0ea6ba27fb3a.zip
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
-rw-r--r--src/nvim/getchar.c7
-rw-r--r--src/nvim/testdir/test_put.vim13
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