vim-patch:7.4.559

Problem:    Appending a block in the middle of a tab does not work correctly
	    when virtualedit is set.
Solution:   Decrement spaces and count, don't reset them. (James McCoy)

https://code.google.com/p/vim/source/detail?r=v7-4-559
This commit is contained in:
Florian Walch
2015-01-03 16:01:17 +01:00
parent d611115305
commit ceb54c55ad
4 changed files with 13 additions and 10 deletions

View File

@@ -515,17 +515,17 @@ static void block_insert(oparg_T *oap, char_u *s, int b_insert, struct block_def
} }
if (has_mbyte && spaces > 0) { if (has_mbyte && spaces > 0) {
int off;
// Avoid starting halfway a multi-byte character. // Avoid starting halfway a multi-byte character.
if (b_insert) { if (b_insert) {
int off = (*mb_head_off)(oldp, oldp + offset + spaces); off = (*mb_head_off)(oldp, oldp + offset + spaces);
} else {
off = (*mb_off_next)(oldp, oldp + offset);
offset += off;
}
spaces -= off; spaces -= off;
count -= off; count -= off;
} else {
int off = (*mb_off_next)(oldp, oldp + offset);
offset += off;
spaces = 0;
count = 0;
}
} }
newp = (char_u *) xmalloc((size_t)(STRLEN(oldp) + s_len + count + 1)); newp = (char_u *) xmalloc((size_t)(STRLEN(oldp) + s_len + count + 1));

View File

@@ -38,11 +38,14 @@ G$khhhhhkkcmno
/^C23$/ /^C23$/
:exe ":norm! l\<C-V>j$hhAab\<Esc>" :exe ":norm! l\<C-V>j$hhAab\<Esc>"
:.,/^$/w >> test.out :.,/^$/w >> test.out
:" Test for Visual block insert when virtualedit=all :" Test for Visual block insert when virtualedit=all and utf-8 encoding
:set ve=all :set ve=all enc=utf-8
:/\t\tline :/\t\tline
:exe ":norm! 07l\<C-V>jjIx\<Esc>" :exe ":norm! 07l\<C-V>jjIx\<Esc>"
:set ve= :.,/^$/w >> test.out
:" Test for Visual block append when virtualedit=all
:exe ":norm! 012l\<C-v>jjAx\<Esc>"
:set ve= enc=latin1
:.,/^$/w >> test.out :.,/^$/w >> test.out
:" gUe must uppercase a whole word, also when <20> changes to SS :" gUe must uppercase a whole word, also when <20> changes to SS
Gothe youtu<74>euu endYpk0wgUe Gothe youtu<74>euu endYpk0wgUe

Binary file not shown.

View File

@@ -179,7 +179,7 @@ static char *(features[]) = {
static int included_patches[] = { static int included_patches[] = {
//560 NA //560 NA
//559, 559,
//558 NA //558 NA
//557 NA //557 NA
//556 NA //556 NA