diff --git a/src/register.c b/src/register.c index 1fdebce95e..de89b18646 100644 --- a/src/register.c +++ b/src/register.c @@ -2021,7 +2021,7 @@ do_put( curwin->w_cursor.col += bd.startspaces; } - changed_lines(lnum, 0, curwin->w_cursor.lnum, nr_lines); + changed_lines(lnum, 0, curwin->w_cursor.lnum - nr_lines, nr_lines); // Set '[ mark. curbuf->b_op_start = curwin->w_cursor; diff --git a/src/testdir/test_listener.vim b/src/testdir/test_listener.vim index 91f0db2a15..8cbd15377a 100644 --- a/src/testdir/test_listener.vim +++ b/src/testdir/test_listener.vim @@ -782,4 +782,23 @@ func Test_redraw_listener_partial() call redraw_listener_add(#{on_start: function("s:OnRedraw", [1])}) endfunc +func Test_listener_blockwise_paste() + new + call setline(1, ['1', '2', '3']) + let s:list = [] + let id = listener_add('s:StoreListArgs') + + " yank a blockwise selection and paste at the end of the buffer, which + " appends new lines + call feedkeys("1G0\2jyGp", 'xt') + call listener_flush() + " the listener should report correct lnume (before the change) and added + call assert_equal(3, s:start) + call assert_equal(4, s:end) + call assert_equal(2, s:added) + + call listener_remove(id) + bwipe! +endfunc + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/version.c b/src/version.c index 2dae07da4c..b1b44b7f2f 100644 --- a/src/version.c +++ b/src/version.c @@ -734,6 +734,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 262, /**/ 261, /**/