updated for version 7.4.408 v7.4.408
authorBram Moolenaar <Bram@vim.org>
Sat, 16 Aug 2014 16:36:43 +0000 (18:36 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 16 Aug 2014 16:36:43 +0000 (18:36 +0200)
Problem:    Visual block insert breaks a multi-byte character.
Solution:   Calculate the position properly. (Yasuhiro Matsumoto)

src/ops.c
src/testdir/Make_amiga.mak
src/testdir/Make_dos.mak
src/testdir/Make_ming.mak
src/testdir/Make_os2.mak
src/testdir/Make_vms.mms
src/testdir/Makefile
src/version.c

index 2b400916f74cb17ec29293499239c651a813d2d2..86408a49448e6578f5a4c555294da541c04a6bfd 100644 (file)
--- a/src/ops.c
+++ b/src/ops.c
@@ -609,6 +609,26 @@ block_insert(oap, s, b_insert, bdp)
            }
        }
 
+#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;
index 030542430c690dad2485d52b61f3fe86be8c5d0e..5012812448ede6d8bf790386f59bc29f76d0615c 100644 (file)
@@ -38,13 +38,14 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
                test104.out test105.out test106.out test107.out \
                test_autoformat_join.out \
                test_breakindent.out \
-               test_listlbr.out \
-               test_listlbr_utf8.out \
-               test_qf_title.out \
                test_changelist.out \
                test_eval.out \
                test_insertcount.out \
-               test_options.out
+               test_listlbr.out \
+               test_listlbr_utf8.out \
+               test_options.out \
+               test_qf_title.out \
+               test_utf8.out
 
 .SUFFIXES: .in .out
 
@@ -170,10 +171,11 @@ test106.out: test106.in
 test107.out: test107.in
 test_autoformat_join.out: test_autoformat_join.in
 test_breakindent.out: test_breakindent.in
-test_listlbr.out: test_listlbr.in
-test_listlbr_utf8.out: test_listlbr_utf8.in
-test_qf_title.out: test_qf_title.in
 test_changelist.out: test_changelist.in
 test_eval.out: test_eval.in
 test_insertcount.out: test_insertcount.in
+test_listlbr.out: test_listlbr.in
+test_listlbr_utf8.out: test_listlbr_utf8.in
 test_options.out: test_options.in
+test_qf_title.out: test_qf_title.in
+test_utf8.out: test_utf8.in
index 232e8809d3ba818a1bb6382d8fdc5b128a5c23c0..cd7aa4d487c38b545ef65511916f3e6d170652a7 100644 (file)
@@ -37,13 +37,14 @@ SCRIPTS =   test3.out test4.out test5.out test6.out test7.out \
                test105.out test106.out  test107.out\
                test_autoformat_join.out \
                test_breakindent.out \
-               test_listlbr.out \
-               test_listlbr_utf8.out \
-               test_qf_title.out \
                test_changelist.out \
                test_eval.out \
                test_insertcount.out \
-               test_options.out
+               test_listlbr.out \
+               test_listlbr_utf8.out \
+               test_options.out \
+               test_qf_title.out \
+               test_utf8.out
 
 SCRIPTS32 =    test50.out test70.out
 
index eb533c9d0b339e7562838a263edce497fe878223..782f89d6467d8e67e539810524830a799b5273c0 100644 (file)
@@ -57,13 +57,14 @@ SCRIPTS =   test3.out test4.out test5.out test6.out test7.out \
                test105.out test106.out test107.out \
                test_autoformat_join.out \
                test_breakindent.out \
-               test_listlbr.out \
-               test_listlbr_utf8.out \
-               test_qf_title.out \
                test_changelist.out \
                test_eval.out \
                test_insertcount.out \
-               test_options.out
+               test_listlbr.out \
+               test_listlbr_utf8.out \
+               test_options.out \
+               test_qf_title.out \
+               test_utf8.out
 
 SCRIPTS32 =    test50.out test70.out
 
index 0bd0096061ec1b359dfa4b2decc1267d85651119..d3e833793a07d5a06d723aed059ece9fb87066f1 100644 (file)
@@ -38,14 +38,15 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
                test100.out test101.out test102.out test103.out test104.out \
                test105.out test106.out test107.out \
                test_autoformat_join.out \
+               test_breakindent.out \
                test_changelist.out \
                test_eval.out \
                test_insertcount.out \
-               test_breakindent.out \
                test_listlbr.out \
                test_listlbr_utf8.out \
+               test_options.out \
                test_qf_title.out \
-               test_options.out
+               test_utf8.out
 
 .SUFFIXES: .in .out
 
index 7ccdf24e7205f29343aee1dae239757aa99d4240..3c7afc346d6247fb22d0e680161e85c891192a0d 100644 (file)
@@ -4,7 +4,7 @@
 # Authors:     Zoltan Arpadffy, <arpadffy@polarhome.com>
 #              Sandor Kopanyi,  <sandor.kopanyi@mailbox.hu>
 #
-# Last change:  2014 Jul 30
+# Last change:  2014 Aug 16
 #
 # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
 # Edit the lines in the Configuration section below to select.
@@ -98,13 +98,14 @@ SCRIPT = test1.out  test2.out  test3.out  test4.out  test5.out  \
         test105.out test106.out test107.out \
         test_autoformat_join.out \
         test_breakindent.out \
-        test_listlbr.out \
-        test_listlbr_utf8.out \
-        test_qf_title.out \
         test_changelist.out \
         test_eval.out \
         test_insertcount.out \
-        test_options.out
+        test_listlbr.out \
+        test_listlbr_utf8.out \
+        test_options.out \
+        test_qf_title.out \
+        test_utf8.out
 
 # Known problems:
 # test17: ?
index f2b22163782647611594284215a2eedcef231afa..59fe0116961e0ec74d5ca0c0f6c6d79f2608ba35 100644 (file)
@@ -35,13 +35,14 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
                test104.out test105.out test106.out test107.out \
                test_autoformat_join.out \
                test_breakindent.out \
-               test_listlbr.out \
-               test_listlbr_utf8.out \
-               test_qf_title.out \
                test_changelist.out \
                test_eval.out \
                test_insertcount.out \
-               test_options.out
+               test_listlbr.out \
+               test_listlbr_utf8.out \
+               test_options.out \
+               test_qf_title.out \
+               test_utf8.out
 
 SCRIPTS_GUI = test16.out
 
index 2b5dc454e58fa0d12b2d54339c945e66afc3f847..4a876b5c7292bc78a38a71400d1e96dfec320c03 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    408,
 /**/
     407,
 /**/