mirror of
https://github.com/vim/vim.git
synced 2025-09-26 04:04:07 -04:00
updated for version 7.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)
This commit is contained in:
@@ -2194,6 +2194,7 @@ op_replace(oap, c)
|
|||||||
{
|
{
|
||||||
/* This is slow, but it handles replacing a single-byte
|
/* This is slow, but it handles replacing a single-byte
|
||||||
* with a multi-byte and the other way around. */
|
* with a multi-byte and the other way around. */
|
||||||
|
if (curwin->w_cursor.lnum == oap->end.lnum)
|
||||||
oap->end.col += (*mb_char2len)(c) - (*mb_char2len)(n);
|
oap->end.col += (*mb_char2len)(c) - (*mb_char2len)(n);
|
||||||
n = State;
|
n = State;
|
||||||
State = REPLACE;
|
State = REPLACE;
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
Test for multi-byte text formatting.
|
Test for multi-byte text formatting.
|
||||||
Also test, that 'mps' with multibyte chars works.
|
Also test, that 'mps' with multibyte chars works.
|
||||||
|
And test "ra" on multi-byte characters.
|
||||||
|
|
||||||
STARTTEST
|
STARTTEST
|
||||||
:so mbyte.vim
|
:so mbyte.vim
|
||||||
@@ -143,6 +144,15 @@ ENDTEST
|
|||||||
{
|
{
|
||||||
‘ two three ’ four
|
‘ two three ’ four
|
||||||
}
|
}
|
||||||
|
STARTTEST
|
||||||
|
/^ra test
|
||||||
|
jVjra
|
||||||
|
ENDTEST
|
||||||
|
|
||||||
|
ra test
|
||||||
|
abba
|
||||||
|
aab
|
||||||
|
|
||||||
STARTTEST
|
STARTTEST
|
||||||
:g/^STARTTEST/.,/^ENDTEST/d
|
:g/^STARTTEST/.,/^ENDTEST/d
|
||||||
:1;/^Results/,$wq! test.out
|
:1;/^Results/,$wq! test.out
|
||||||
|
@@ -144,3 +144,8 @@ a
|
|||||||
{
|
{
|
||||||
four
|
four
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ra test
|
||||||
|
aaaa
|
||||||
|
aaa
|
||||||
|
|
||||||
|
@@ -728,6 +728,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
853,
|
||||||
/**/
|
/**/
|
||||||
852,
|
852,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user