To: vim-dev@vim.org Subject: Patch 6.4b.003 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.4b.003 (after 6.4b.002) Problem: The problem still exists when 'encoding' is set to "cp936". Solution: Fix the problem in getvvcol(), compute the coladd field correctly. Files: src/charset.c, src/ops.c *** ../vim-6.4b.002/src/charset.c Sun Apr 10 17:35:14 2005 --- src/charset.c Fri Oct 14 17:24:31 2005 *************** *** 1374,1381 **** if (c != TAB && vim_isprintc(c)) { endadd = char2cells(c) - 1; ! if (coladd >= endadd) ! coladd -= endadd; else coladd = 0; } --- 1374,1381 ---- if (c != TAB && vim_isprintc(c)) { endadd = char2cells(c) - 1; ! if (coladd > endadd) /* past end of line */ ! endadd = 0; else coladd = 0; } *** ../vim-6.4b.002/src/ops.c Wed Oct 12 20:56:28 2005 --- src/ops.c Fri Oct 14 17:36:07 2005 *************** *** 3619,3627 **** && curwin->w_cursor.col > 0 && !(restart_edit || (State & INSERT))) { ! #ifdef FEAT_VIRTUALEDIT ! col = curwin->w_cursor.col; ! #endif --curwin->w_cursor.col; #ifdef FEAT_MBYTE if (has_mbyte) --- 3619,3625 ---- && curwin->w_cursor.col > 0 && !(restart_edit || (State & INSERT))) { ! /* Put the cursor on the last character in the line. */ --curwin->w_cursor.col; #ifdef FEAT_MBYTE if (has_mbyte) *************** *** 3629,3635 **** #endif #ifdef FEAT_VIRTUALEDIT if (ve_flags == VE_ALL) ! curwin->w_cursor.coladd = col - curwin->w_cursor.col; #endif } } --- 3627,3639 ---- #endif #ifdef FEAT_VIRTUALEDIT if (ve_flags == VE_ALL) ! { ! colnr_T scol, ecol; ! ! /* Coladd is set to the width of the last character. */ ! getvcol(curwin, &curwin->w_cursor, &scol, NULL, &ecol); ! curwin->w_cursor.coladd = ecol - scol + 1; ! } #endif } } *** ../vim-6.4b.002/src/version.c Wed Oct 12 20:56:28 2005 --- src/version.c Fri Oct 14 17:40:42 2005 *************** *** 643,644 **** --- 643,646 ---- { /* Add new patch number below this line */ + /**/ + 3, /**/ -- If Pacman had affected us as kids we'd be running around in dark rooms, munching pills and listening to repetitive music. -- Marcus Brigstocke /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Buy LOTR 3 and help AIDS victims -- http://ICCF.nl/lotr.html ///