summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvimboss <devnull@localhost>2008-02-06 13:44:43 +0000
committervimboss <devnull@localhost>2008-02-06 13:44:43 +0000
commitd51a67b9dc383fc8bc2dd74e4c3d86bdc2c09898 (patch)
tree83aebe1b3ba0ab19d7f608206beb08cf03a206e7
parent2d50d7171fe82b9fc5ab4678870038761a3f6c33 (diff)
downloadvim-d51a67b9dc383fc8bc2dd74e4c3d86bdc2c09898.tar.gz
updated for version 7.1-243v7.1.243v7-1-243
-rw-r--r--src/ops.c21
-rw-r--r--src/testdir/test39.in19
-rw-r--r--src/testdir/test39.ok8
-rw-r--r--src/version.c2
4 files changed, 41 insertions, 9 deletions
diff --git a/src/ops.c b/src/ops.c
index 1d5d3bfa..2907d8a5 100644
--- 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;
}
diff --git a/src/testdir/test39.in b/src/testdir/test39.in
index d7f294b3..a16d4d99 100644
--- a/src/testdir/test39.in
+++ b/src/testdir/test39.in
@@ -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
jlllljj>wlljlll>
@@ -14,7 +16,22 @@ GklkkkIxyz
Gllllkkklllrq
:" Test block-change
G$khhhhhkkcmno
-:$-4,$wq! test.out
+:$-4,$w! test.out
+:" gUe must uppercase a whole word, also when ß changes to SS
+Gothe youtußeuu endYpk0wgUe
+:" gUfx must uppercase until x, inclusive.
+O- youßtußexu -0fogUfx
+:" VU must uppercase a whole line
+YpkVU
+:" same, when it's the last line in the buffer
+YPGi111VUddP
+:" Uppercase two lines
+Oblah di
+doh dutVkUj
+:" Uppercase part of two lines
+ddppi333k0i222fyllvjfuUk
+:/^the/,$w >> test.out
+:qa!
ENDTEST
abcdefghijklm
diff --git a/src/testdir/test39.ok b/src/testdir/test39.ok
index 6fa2867e..38a5bc3a 100644
--- a/src/testdir/test39.ok
+++ b/src/testdir/test39.ok
@@ -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
diff --git a/src/version.c b/src/version.c
index 7d703482..3059f3fa 100644
--- a/src/version.c
+++ b/src/version.c
@@ -667,6 +667,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 243,
+/**/
242,
/**/
241,