changeset 6460:29f5cfca3388 v7.4.559

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)
author Bram Moolenaar <bram@vim.org>
date Wed, 17 Dec 2014 18:35:42 +0100
parents 342bbee39831
children ad262c7047d9
files src/ops.c src/testdir/test39.in src/testdir/test39.ok src/version.c
diffstat 4 files changed, 14 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- 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
 
--- a/src/testdir/test39.in
+++ b/src/testdir/test39.in
@@ -38,11 +38,14 @@ G$khhhhhkkcmno
 /^C23$/
 :exe ":norm! l\<C-V>j$hhAab\<Esc>"
 :.,/^$/w >> test.out
-:" Test for Visual block insert when virtualedit=all
-:set ve=all
+:" Test for Visual block insert when virtualedit=all and utf-8 encoding
+:set ve=all enc=utf-8
 :/\t\tline
 :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
 :" gUe must uppercase a whole word, also when ß changes to SS
 Gothe youtußeuu endYpk0wgUe
index d8e901563af492e50b8f70c470fee5678644dc0c..5c517e2223d5c830ca8297b7c8ec71d180777d82
GIT binary patch
literal 584
zc$|e!+e*Vg5cRbK{=@u0!R#hYTS}odfeK<Cnt(p;Ep0VT6bvN(tiR&y(%Ljc+=p}a
zTxNDf(|$>%O}^V7Uf+r%2r@qCAmXvCM(9pIG`S5C|4Mh1I)_$U=adV9NB~kwL;_Gs
zArgSr8j%2C@xE+qhgjMQv9b+f?FuW#g#<sCgha4r96R#<910l%oc`C~s5q3y>uJ{0
zyfbjd-dxva!!~XC+#7sJvNYRn<19l{Y8YdikaX5_jblhRakmpcMc{effV+NNZ7_O(
zC?U#HV2s)QZFSY+od3>#o4R(7dW`!4gwxsJZ8p7~1XuW9|Hd^hsH$S_W0mLgJNN-l
Cf0oAp
--- a/src/version.c
+++ b/src/version.c
@@ -742,6 +742,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    559,
+/**/
     558,
 /**/
     557,