summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-03-07 18:50:57 +0100
committerBram Moolenaar <Bram@vim.org>2013-03-07 18:50:57 +0100
commitdb813951c4fc1f91aaaeb4e72d37942e13cb1f0e (patch)
treee337d3b553e9b91c62e9181c4163b269ba7065a3
parente2e663f67d9f44ae876659bd492f734d48bd2970 (diff)
downloadvim-git-db813951c4fc1f91aaaeb4e72d37942e13cb1f0e.tar.gz
updated for version 7.3.853v7.3.853
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)
-rw-r--r--src/ops.c3
-rw-r--r--src/testdir/test69.in10
-rw-r--r--src/testdir/test69.ok5
-rw-r--r--src/version.c2
4 files changed, 19 insertions, 1 deletions
diff --git a/src/ops.c b/src/ops.c
index f3588eb27..f3a26da44 100644
--- 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);
diff --git a/src/testdir/test69.in b/src/testdir/test69.in
index 5c9a2f3d4..9558cb817 100644
--- a/src/testdir/test69.in
+++ b/src/testdir/test69.in
@@ -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
@@ -144,6 +145,15 @@ ENDTEST
‘ two three ’ four
}
STARTTEST
+/^ra test
+jVjra
+ENDTEST
+
+ra test
+abba
+aab
+
+STARTTEST
:g/^STARTTEST/.,/^ENDTEST/d
:1;/^Results/,$wq! test.out
ENDTEST
diff --git a/src/testdir/test69.ok b/src/testdir/test69.ok
index 59a5a6e54..f742ee174 100644
--- a/src/testdir/test69.ok
+++ b/src/testdir/test69.ok
@@ -144,3 +144,8 @@ a
{
four
}
+
+ra test
+aaaa
+aaa
+
diff --git a/src/version.c b/src/version.c
index eeb4f6128..b6e4f3894 100644
--- a/src/version.c
+++ b/src/version.c
@@ -729,6 +729,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 853,
+/**/
852,
/**/
851,