Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 #2945)
  • Loading branch information
brammool committed May 23, 2018
1 parent d315cf5 commit 833093b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/getchar.c
Expand Up @@ -844,6 +844,14 @@ 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);
}

Expand Down
13 changes: 13 additions & 0 deletions src/testdir/test_put.vim
Expand Up @@ -45,3 +45,16 @@ func Test_put_lines()
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
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -761,6 +761,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
22,
/**/
21,
/**/
Expand Down

0 comments on commit 833093b

Please sign in to comment.