To: vim_dev@googlegroups.com Subject: Patch 7.4.147 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.147 Problem: Cursor moves to wrong position when using "gj" after "$" and virtual editing is active. Solution: Make "gj" behave differently when virtual editing is active. (Hirohito Higashi) Files: src/normal.c, src/testdir/test39.in, src/testdir/test39.ok *** ../vim-7.4.146/src/normal.c 2013-12-11 14:54:58.000000000 +0100 --- src/normal.c 2014-01-14 13:13:30.000000000 +0100 *************** *** 4644,4650 **** } #endif ! coladvance(curwin->w_curswant); #if defined(FEAT_LINEBREAK) || defined(FEAT_MBYTE) if (curwin->w_cursor.col > 0 && curwin->w_p_wrap) --- 4644,4653 ---- } #endif ! if (virtual_active() && atend) ! coladvance(MAXCOL); ! else ! coladvance(curwin->w_curswant); #if defined(FEAT_LINEBREAK) || defined(FEAT_MBYTE) if (curwin->w_cursor.col > 0 && curwin->w_p_wrap) *** ../vim-7.4.146/src/testdir/test39.in 2013-11-21 14:39:58.000000000 +0100 --- src/testdir/test39.in 2014-01-14 13:12:34.000000000 +0100 *************** *** 52,57 **** --- 52,63 ---- G3o1234567892k05l2jr G3o987652k02l2jr G3o1234567892k05l2jr G3o987652k02l2jr + :" + :" Test cursor position. When ve=block and Visual block mode and $gj + :set ve=block + :exe ":norm! 2k\$gj\" + :let cpos=getpos("'>") + :$put ='col:'.cpos[2].' off:'.cpos[3] :/^the/,$w >> test.out :qa! ENDTEST *** ../vim-7.4.146/src/testdir/test39.ok 2013-11-21 14:39:58.000000000 +0100 --- src/testdir/test39.ok 2014-01-14 13:12:46.000000000 +0100 *************** *** 43,45 **** --- 43,46 ---- 9865 9865 9865 + col:4 off:0 *** ../vim-7.4.146/src/version.c 2014-01-14 12:57:00.000000000 +0100 --- src/version.c 2014-01-14 13:11:41.000000000 +0100 *************** *** 740,741 **** --- 740,743 ---- { /* Add new patch number below this line */ + /**/ + 147, /**/ -- Although the scythe isn't pre-eminent among the weapons of war, anyone who has been on the wrong end of, say, a peasants' revolt will know that in skilled hands it is fearsome. -- (Terry Pratchett, Mort) /// 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 ///