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) {
int off;
// Avoid starting halfway a multi-byte character.
if (b_insert) {
int off = (*mb_head_off)(oldp, oldp + offset + spaces);
spaces -= off;
count -= off;
off = (*mb_head_off)(oldp, oldp + offset + spaces);
} else {
int off = (*mb_off_next)(oldp, oldp + offset);
off = (*mb_off_next)(oldp, oldp + offset);
offset += off;
spaces = 0;
count = 0;
}
spaces -= off;
count -= off;
}
newp = (char_u *) xmalloc((size_t)(STRLEN(oldp) + s_len + count + 1));