]> granicus.if.org Git - vim/commitdiff
patch 7.4.1491 v7.4.1491
authorBram Moolenaar <Bram@vim.org>
Sat, 5 Mar 2016 16:25:39 +0000 (17:25 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 5 Mar 2016 16:25:39 +0000 (17:25 +0100)
Problem:    Visual-block shift breaks multi-byte characters.
Solution:   Compute column differently. (Yasuhiro Matsumoto) Add a test.

src/ops.c
src/testdir/Make_all.mak
src/version.c

index 4ad982f7f64315ea966739bebdfe8d8daa809861..fa159e983ccb6b9c37bf55fa3efcc0ed77738bee 100644 (file)
--- a/src/ops.c
+++ b/src/ops.c
@@ -410,7 +410,15 @@ shift_block(oparg_T *oap, int amount)
        {
 #ifdef FEAT_MBYTE
            if (has_mbyte)
-               bd.textstart += (*mb_ptr2len)(bd.textstart);
+           {
+               if ((*mb_ptr2len)(bd.textstart) == 1)
+                   ++bd.textstart;
+               else
+               {
+                   ws_vcol = 0;
+                   bd.startspaces = 0;
+               }
+           }
            else
 #endif
                ++bd.textstart;
index 854f95bcc1ee93ee5cb38d393f822b5d4cc7465e..854220f0e074e588bb134364ef1746f8bb778075 100644 (file)
@@ -184,6 +184,7 @@ NEW_TESTS = test_arglist.res \
            test_syntax.res \
            test_viminfo.res \
            test_viml.res \
+           test_visual.res \
            test_alot.res
 
 
index af39e7e958b1b27e9a7d0ab59f723986d6cbc22a..bc1b8120362d5bafac1d81f69b16978729904701 100644 (file)
@@ -743,6 +743,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1491,
 /**/
     1490,
 /**/