To: vim_dev@googlegroups.com Subject: Patch 8.2.3540 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.3540 Problem: The mark '] is wrong after put with a count. (Naohiro Ono) Solution: Use the right line number. (closes #8956) Files: src/register.c, src/testdir/test_put.vim *** ../vim-8.2.3539/src/register.c 2021-10-10 12:35:13.331259343 +0100 --- src/register.c 2021-10-19 19:52:55.489760512 +0100 *************** *** 2183,2189 **** curbuf->b_op_start.lnum, nr_lines); // put '] mark at last inserted character ! curbuf->b_op_end.lnum = lnum; // correct length for change in indent col = (colnr_T)STRLEN(y_array[y_size - 1]) - lendiff; if (col > 1) --- 2183,2189 ---- curbuf->b_op_start.lnum, nr_lines); // put '] mark at last inserted character ! 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) *** ../vim-8.2.3539/src/testdir/test_put.vim 2021-10-11 20:26:43.977511961 +0100 --- src/testdir/test_put.vim 2021-10-19 19:51:56.949058769 +0100 *************** *** 136,141 **** --- 136,153 ---- 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 *** ../vim-8.2.3539/src/version.c 2021-10-19 14:21:59.203301227 +0100 --- src/version.c 2021-10-19 19:45:43.167400616 +0100 *************** *** 759,760 **** --- 759,762 ---- { /* Add new patch number below this line */ + /**/ + 3540, /**/ -- hundred-and-one symptoms of being an internet addict: 200. You really believe in the concept of a "paperless" office. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///