summaryrefslogtreecommitdiff
path: root/src/ops.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2014-12-17 18:35:42 +0100
committerBram Moolenaar <Bram@vim.org>2014-12-17 18:35:42 +0100
commitfc3f23bedfc848cd77f97c62bf4f39a01d46994e (patch)
treef96f2b403fd9c97130302e8e0db9db4b2411e130 /src/ops.c
parent527a6785c73306ff72d83cbc2d1ea14f37aca142 (diff)
downloadvim-fc3f23bedfc848cd77f97c62bf4f39a01d46994e.zip
updated for version 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)
Diffstat (limited to 'src/ops.c')
-rw-r--r--src/ops.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/ops.c b/src/ops.c
index edc84a07a..0db8c2d25 100644
--- a/src/ops.c
+++ b/src/ops.c
@@ -612,20 +612,20 @@ block_insert(oap, s, b_insert, bdp)
#ifdef FEAT_MBYTE
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;
}
#endif