To: [email protected]
Subject: Patch 6.4b.002
Fcc: outbox
From: Bram Moolenaar <[email protected]>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
------------

Patch 6.4b.002
Problem:    In Insert mode, pasting a multi-byte character after the end of
           the line leaves the cursor just before that character.
Solution:   Make sure "gP" leaves the cursor in the right place when
           'virtualedit' is set.
Files:      src/ops.c


*** ../vim-6.4b.001/src/ops.c   Sat Dec 11 16:11:42 2004
--- src/ops.c   Wed Oct 12 20:51:39 2005
***************
*** 3619,3628 ****
           && curwin->w_cursor.col > 0
           && !(restart_edit || (State & INSERT)))
     {
       --curwin->w_cursor.col;
 #ifdef FEAT_VIRTUALEDIT
       if (ve_flags == VE_ALL)
!           ++curwin->w_cursor.coladd;
 #endif
     }
 }
--- 3619,3635 ----
           && 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)
+           mb_adjust_cursor();
+ #endif
 #ifdef FEAT_VIRTUALEDIT
       if (ve_flags == VE_ALL)
!           curwin->w_cursor.coladd = col - curwin->w_cursor.col;
 #endif
     }
 }
*** ../vim-6.4b.001/src/version.c       Tue Oct 11 10:05:39 2005
--- src/version.c       Wed Oct 12 20:52:41 2005
***************
*** 643,644 ****
--- 643,646 ----
 {   /* Add new patch number below this line */
+ /**/
+     2,
 /**/

--
hundred-and-one symptoms of being an internet addict:
16. You step out of your room and realize that your parents have moved and
   you don't have a clue when it happened.

/// Bram Moolenaar -- [email protected] -- 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   ///