diff --git a/src/register.c b/src/register.c index 9f179ea151..522500ce1d 100644 --- a/src/register.c +++ b/src/register.c @@ -2183,7 +2183,7 @@ error: curbuf->b_op_start.lnum, nr_lines); // put '] mark at last inserted character - curbuf->b_op_end.lnum = lnum; + curbuf->b_op_end.lnum = new_lnum; // correct length for change in indent col = (colnr_T)STRLEN(y_array[y_size - 1]) - lendiff; if (col > 1) diff --git a/src/testdir/test_put.vim b/src/testdir/test_put.vim index 4e3294679c..a6bed75358 100644 --- a/src/testdir/test_put.vim +++ b/src/testdir/test_put.vim @@ -136,6 +136,18 @@ func Test_gp_with_count_leaves_cursor_at_end() bwipe! endfunc +func Test_p_with_count_leaves_mark_at_end() + new + call setline(1, '<---->') + call setreg('@', "start\nend", 'c') + normal 1G3|3p + call assert_equal([0, 1, 4, 0], getpos(".")) + call assert_equal(['<--start', 'endstart', 'endstart', 'end-->'], getline(1, '$')) + call assert_equal([0, 4, 3, 0], getpos("']")) + + bwipe! +endfunc + func Test_very_large_count() " FIXME: should actually check if sizeof(int) == sizeof(long) CheckNotMSWindows diff --git a/src/version.c b/src/version.c index 28a70fd39c..c430ff1702 100644 --- a/src/version.c +++ b/src/version.c @@ -757,6 +757,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 3540, /**/ 3539, /**/