]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.853 v7.3.853
authorBram Moolenaar <Bram@vim.org>
Thu, 7 Mar 2013 17:50:57 +0000 (18:50 +0100)
committerBram Moolenaar <Bram@vim.org>
Thu, 7 Mar 2013 17:50:57 +0000 (18:50 +0100)
Problem:    Using "ra" in multiple lines on multi-byte characters leaves a few
            characters not replaced.
Solution:   Adjust the end column only in the last line. (Yasuhiro Matsumoto)

src/ops.c
src/testdir/test69.in
src/testdir/test69.ok
src/version.c

index f3588eb27901ca370abbda349cedbe3feb7f71ef..f3a26da44a175a6ee471de2a62394401cec560e3 100644 (file)
--- a/src/ops.c
+++ b/src/ops.c
@@ -2194,7 +2194,8 @@ op_replace(oap, c)
                {
                    /* This is slow, but it handles replacing a single-byte
                     * with a multi-byte and the other way around. */
-                   oap->end.col += (*mb_char2len)(c) - (*mb_char2len)(n);
+                   if (curwin->w_cursor.lnum == oap->end.lnum)
+                       oap->end.col += (*mb_char2len)(c) - (*mb_char2len)(n);
                    n = State;
                    State = REPLACE;
                    ins_char(c);
index 5c9a2f3d4cd958d4f7e9a15a6a8c0fac1dfa6498..9558cb817807a79c76f8f76b47d07445e8028a4d 100644 (file)
@@ -1,5 +1,6 @@
 Test for multi-byte text formatting.
 Also test, that 'mps' with multibyte chars works.
+And test "ra" on multi-byte characters.
 
 STARTTEST
 :so mbyte.vim
@@ -143,6 +144,15 @@ ENDTEST
 {
 ‘ two three ’ four
 }
+STARTTEST
+/^ra test
+jVjra
+ENDTEST
+
+ra test
+abba
+aab
+
 STARTTEST
 :g/^STARTTEST/.,/^ENDTEST/d
 :1;/^Results/,$wq! test.out
index 59a5a6e54ede21ceb078dddd8cb70b2c71710aa5..f742ee174039d1bf48b1e54a65e91625ba84ccc4 100644 (file)
@@ -144,3 +144,8 @@ a
 {
  four
 }
+
+ra test
+aaaa
+aaa
+
index eeb4f6128052df479a1c80bf93fb4074d91ba3fa..b6e4f3894a11fb1c0768792d352178fffbc94b29 100644 (file)
@@ -728,6 +728,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    853,
 /**/
     852,
 /**/