To: vim_dev@googlegroups.com Subject: Patch 8.2.1170 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.1170 Problem: Cursor off by one with block paste while 'virtualedit' is "all". Solution: Adjust condition. (Hugo Gualandi, closes #6430) Files: src/register.c, src/testdir/test_registers.vim *** ../vim-8.2.1169/src/register.c 2020-06-29 20:23:29.374981834 +0200 --- src/register.c 2020-07-10 20:20:12.154855392 +0200 *************** *** 1764,1770 **** { if (dir == FORWARD && c == NUL) ++col; ! if (dir != FORWARD && c != NUL) ++curwin->w_cursor.col; if (c == TAB) { --- 1764,1770 ---- { if (dir == FORWARD && c == NUL) ++col; ! if (dir != FORWARD && c != NUL && curwin->w_cursor.coladd > 0) ++curwin->w_cursor.col; if (c == TAB) { *** ../vim-8.2.1169/src/testdir/test_registers.vim 2020-06-22 20:30:24.202479096 +0200 --- src/testdir/test_registers.vim 2020-07-10 20:20:12.154855392 +0200 *************** *** 659,662 **** --- 659,680 ---- bwipe! endfunc + func Test_ve_blockpaste() + new + set ve=all + 0put =['QWERTZ','ASDFGH'] + call cursor(1,1) + exe ":norm! \3ljdP" + call assert_equal(1, col('.')) + call assert_equal(getline(1, 2), ['QWERTZ', 'ASDFGH']) + call cursor(1,1) + exe ":norm! \3ljd" + call cursor(1,1) + norm! $3lP + call assert_equal(5, col('.')) + call assert_equal(getline(1, 2), ['TZ QWER', 'GH ASDF']) + set ve&vim + bwipe! + endfunc + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.1169/src/version.c 2020-07-10 20:03:00.539042582 +0200 --- src/version.c 2020-07-10 20:23:27.538037087 +0200 *************** *** 756,757 **** --- 756,759 ---- { /* Add new patch number below this line */ + /**/ + 1170, /**/ -- Contrary to popular belief, it's often your clothing that gets promoted, not you. (Scott Adams - The Dilbert principle) /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///