updated for version 7.4.408
Problem: Visual block insert breaks a multi-byte character.
Solution: Calculate the position properly. (Yasuhiro Matsumoto)
diff --git a/src/ops.c b/src/ops.c
index 2b40091..86408a4 100644
--- a/src/ops.c
+++ b/src/ops.c
@@ -609,6 +609,26 @@
}
}
+#ifdef FEAT_MBYTE
+ if (has_mbyte && spaces > 0)
+ {
+ /* Avoid starting halfway a multi-byte character. */
+ if (b_insert)
+ {
+ int off = (*mb_head_off)(oldp, oldp + offset + spaces);
+ spaces -= off;
+ count -= off;
+ }
+ else
+ {
+ int off = (*mb_off_next)(oldp, oldp + offset);
+ offset += off;
+ spaces = 0;
+ count = 0;
+ }
+ }
+#endif
+
newp = alloc_check((unsigned)(STRLEN(oldp)) + s_len + count + 1);
if (newp == NULL)
continue;