]> granicus.if.org Git - vim/commitdiff
updated for version 7.2-279 v7.2.279
authorBram Moolenaar <Bram@vim.org>
Tue, 3 Nov 2009 15:44:21 +0000 (15:44 +0000)
committerBram Moolenaar <Bram@vim.org>
Tue, 3 Nov 2009 15:44:21 +0000 (15:44 +0000)
src/misc2.c
src/ops.c
src/version.c

index 05379931c503404cffbabb3c6a46d5614ee8d99d..5fc64bb8f34277b02559e0175270ff438ea7c3c4 100644 (file)
@@ -156,7 +156,7 @@ coladvance2(pos, addspaces, finetune, wcol)
                    || ((ve_flags & VE_ONEMORE) && wcol < MAXCOL)
 #endif
                    ;
-    line = ml_get_curline();
+    line = ml_get_buf(curbuf, pos->lnum, FALSE);
 
     if (wcol >= MAXCOL)
     {
@@ -332,9 +332,9 @@ coladvance2(pos, addspaces, finetune, wcol)
 #endif
 
 #ifdef FEAT_MBYTE
-    /* prevent cursor from moving on the trail byte */
+    /* prevent from moving onto a trail byte */
     if (has_mbyte)
-       mb_adjust_cursor();
+       mb_adjustpos(pos);
 #endif
 
     if (col < wcol)
index b21f4c2509fe10d0d6a637f95a266fc8cfbb8013..e5db31347ca4495482d7a354f28838fa0bc613c8 100644 (file)
--- a/src/ops.c
+++ b/src/ops.c
@@ -2020,6 +2020,7 @@ op_replace(oap, c)
        bd.is_MAX = (curwin->w_curswant == MAXCOL);
        for ( ; curwin->w_cursor.lnum <= oap->end.lnum; ++curwin->w_cursor.lnum)
        {
+           curwin->w_cursor.col = 0;  /* make sure cursor position is valid */
            block_prep(oap, &bd, curwin->w_cursor.lnum, TRUE);
            if (bd.textlen == 0 && (!virtual_op || bd.is_MAX))
                continue;           /* nothing to replace */
@@ -2035,6 +2036,7 @@ op_replace(oap, c)
            {
                pos_T vpos;
 
+               vpos.lnum = curwin->w_cursor.lnum;
                getvpos(&vpos, oap->start_vcol);
                bd.startspaces += vpos.coladd;
                n = bd.startspaces;
@@ -2693,11 +2695,8 @@ op_change(oap)
                         * initial coladd offset as part of "startspaces" */
                        if (bd.is_short)
                        {
-                           linenr_T lnum = curwin->w_cursor.lnum;
-
-                           curwin->w_cursor.lnum = linenr;
+                           vpos.lnum = linenr;
                            (void)getvpos(&vpos, oap->start_vcol);
-                           curwin->w_cursor.lnum = lnum;
                        }
                        else
                            vpos.coladd = 0;
index 9edf072d2ef0f95066878ea431a4760d35bf9922..80bdb240b592a6f3d56d370cce26c361e0e18c07 100644 (file)
@@ -676,6 +676,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    279,
 /**/
     278,
 /**/