To: vim-dev@vim.org Subject: Patch 6.2.084 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.2.084 Problem: "g_" in Visual mode always goes to the character after the line. (Jean-Rene David) Solution: Ignore the NUL at the end of the line. Files: src/normal.c *** ../vim-6.2.083/src/normal.c Mon Jun 2 22:20:28 2003 --- src/normal.c Sun Sep 7 23:26:22 2003 *************** *** 6974,6979 **** --- 6974,6981 ---- break; case '_': + /* "g_": to the last non-blank character in the line or lines + * downward. */ cap->oap->motion_type = MCHAR; cap->oap->inclusive = TRUE; curwin->w_curswant = MAXCOL; *************** *** 6984,6989 **** --- 6986,6996 ---- { char_u *ptr = ml_get_curline(); + /* In Visual mode we may end up after the line. */ + if (curwin->w_cursor.col > 0 && ptr[curwin->w_cursor.col] == NUL) + --curwin->w_cursor.col; + + /* Decrease the cursor column until it's on a non-blank. */ while (curwin->w_cursor.col > 0 && vim_iswhite(ptr[curwin->w_cursor.col])) --curwin->w_cursor.col; *** ../vim-6.2.083/src/version.c Thu Sep 11 21:15:02 2003 --- src/version.c Thu Sep 11 21:18:13 2003 *************** *** 632,633 **** --- 632,635 ---- { /* Add new patch number below this line */ + /**/ + 84, /**/ -- Why don't cannibals eat clowns? Because they taste funny. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///