]> granicus.if.org Git - vim/commitdiff
updated for version 7.1-243 v7.1.243
authorBram Moolenaar <Bram@vim.org>
Wed, 6 Feb 2008 13:44:43 +0000 (13:44 +0000)
committerBram Moolenaar <Bram@vim.org>
Wed, 6 Feb 2008 13:44:43 +0000 (13:44 +0000)
src/ops.c
src/testdir/test39.in
src/testdir/test39.ok
src/version.c

index 1d5d3bfa7e81ae8142f6fe7a73bf7ab65f5d15ed..2907d8a5865ae661eca135189f1608e7ea18cf53 100644 (file)
--- a/src/ops.c
+++ b/src/ops.c
@@ -2197,7 +2197,7 @@ op_tilde(oap)
 #ifdef FEAT_VISUAL
     struct block_def   bd;
 #endif
-    int                        did_change;
+    int                        did_change = FALSE;
 
     if (u_save((linenr_T)(oap->start.lnum - 1),
                                       (linenr_T)(oap->end.lnum + 1)) == FAIL)
@@ -2242,7 +2242,18 @@ op_tilde(oap)
        else if (!oap->inclusive)
            dec(&(oap->end));
 
-       did_change = swapchars(oap->op_type, &pos, oap->end.col - pos.col + 1);
+       if (pos.lnum == oap->end.lnum)
+           did_change = swapchars(oap->op_type, &pos,
+                                                 oap->end.col - pos.col + 1);
+       else
+           for (;;)
+           {
+               did_change |= swapchars(oap->op_type, &pos,
+                               pos.lnum == oap->end.lnum ? oap->end.col + 1:
+                                          (int)STRLEN(ml_get_pos(&pos)));
+               if (ltoreq(oap->end, pos) || inc(&pos) == -1)
+                   break;
+           }
        if (did_change)
        {
            changed_lines(oap->start.lnum, oap->start.col, oap->end.lnum + 1,
@@ -2314,17 +2325,11 @@ swapchars(op_type, pos, length)
     for (todo = length; todo > 0; --todo)
     {
 # ifdef FEAT_MBYTE
-       int pos_col = pos->col;
-
        if (has_mbyte)
            /* we're counting bytes, not characters */
            todo -= (*mb_ptr2len)(ml_get_pos(pos)) - 1;
 # endif
        did_change |= swapchar(op_type, pos);
-# ifdef FEAT_MBYTE
-       /* Changing German sharp s to SS increases the column. */
-       todo += pos->col - pos_col;
-# endif
        if (inc(pos) == -1)    /* at end of file */
            break;
     }
index d7f294b3cadbfce0089e2488fbc2074acd3d69ca..a16d4d99c85102a6517aba045581c096c9d996ef 100644 (file)
@@ -1,8 +1,10 @@
 
 Test Visual block mode commands
+And test "U" in Visual mode, also on German sharp S.
 
 STARTTEST
 :so small.vim
+:so mbyte.vim
 /^abcde
 :" Test shift-right of a block
 jllll\16jj>wll\16jlll>
@@ -14,7 +16,22 @@ Gkl\16kkkIxyz\e
 Gllll\16kkklllrq
 :" Test block-change
 G$khhh\16hhkkcmno\e
-:$-4,$wq! test.out
+:$-4,$w! test.out
+:" gUe must uppercase a whole word, also when ß changes to SS
+Gothe youtußeuu end\eYpk0wgUe
+:" gUfx must uppercase until x, inclusive.
+O- youßtußexu -\e0fogUfx
+:" VU must uppercase a whole line
+YpkVU
+:" same, when it's the last line in the buffer
+YPGi111\eVUddP
+:" Uppercase two lines
+Oblah di
+doh dut\eVkUj
+:" Uppercase part of two lines
+ddppi333\ek0i222\efyllvjfuUk
+:/^the/,$w >> test.out
+:qa!
 ENDTEST
 
 abcdefghijklm
index 6fa2867eb522f33df88280dd20f424112c740795..38a5bc3a683b375df61b0a24ff4f78a98522fb66 100644 (file)
@@ -3,3 +3,11 @@ axyzqqqq   mno       ghijklm
 axyzqqqqef mno        ghijklm
 axyzqqqqefgmnoklm
 abcdqqqqijklm
+the YOUTUSSEUU end
+- yOUSSTUSSEXu -
+THE YOUTUSSEUU END
+111THE YOUTUSSEUU END
+BLAH DI
+DOH DUT
+222the yoUTUSSEUU END
+333THE YOUTUßeuu end
index 7d703482ae3276fb661dedd14f9e17d052a70259..3059f3fabc0487ab9fd992c6bd3f9f74653f0ddf 100644 (file)
@@ -666,6 +666,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    243,
 /**/
     242,
 /**/