]> granicus.if.org Git - vim/commitdiff
patch 7.4.818 v7.4.818
authorBram Moolenaar <Bram@vim.org>
Tue, 11 Aug 2015 15:46:36 +0000 (17:46 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 11 Aug 2015 15:46:36 +0000 (17:46 +0200)
Problem:    'linebreak' breaks c% if the last Visual selection was block.
            (Chris Morganiser, Issue 389)
Solution:   Handle Visual block mode differently. (Christian Brabandt)

src/normal.c
src/testdir/test_listlbr.in
src/testdir/test_listlbr.ok
src/version.c

index 309b895a9f8b72d1573b55bddf42c4855b1ac2bd..a46cc9d641a1ba73183c93d80c1df45ddc53e43b 100644 (file)
@@ -9583,20 +9583,21 @@ nv_cursorhold(cap)
 #endif
 
 /*
- * calculate start/end virtual columns for operating in block mode
+ * Calculate start/end virtual columns for operating in block mode.
  */
     static void
 get_op_vcol(oap, redo_VIsual_vcol, initial)
     oparg_T    *oap;
     colnr_T    redo_VIsual_vcol;
-    int                initial;            /* when true: adjust position for 'selectmode' */
+    int                initial;    /* when TRUE adjust position for 'selectmode' */
 {
     colnr_T        start, end;
 
-    if (VIsual_mode != Ctrl_V)
+    if (VIsual_mode != Ctrl_V
+           || (!initial && oap->end.col < W_WIDTH(curwin)))
        return;
 
-    oap->block_mode = TRUE;
+    oap->block_mode = VIsual_active;
 
 #ifdef FEAT_MBYTE
     /* prevent from moving onto a trail byte */
index 164f12a809869fc72f7ac49172b57753ff528e6c..e5372d4de1fac6ddad446255fe094e1f3e7c6867 100644 (file)
@@ -80,6 +80,13 @@ Go
 aaa
 aaa
 a\e2k\162j~e.
+:let g:test ="Test 10: using normal commands after block-visual"
+:$put =g:test
+:set linebreak
+Go
+abcd{ef
+ghijklm
+no}pqrs\e2k0f{\16\16c%\e
 :%w! test.out
 :qa!
 ENDTEST
index 323bcdee08a7ce0496ebaa469b9597baba50d1e9..295a9f737857c4552ee2addf2854be1e40d12778 100644 (file)
@@ -46,3 +46,6 @@ Test 9: using redo after block visual mode
 AaA
 AaA
 A
+Test 10: using normal commands after block-visual
+
+abcdpqrs
index 177b59102362c10885855854ca98a6d71911abe9..0f48baeca9c033d7556b3a606c509f1b1afe2189 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    818,
 /**/
     817,
 /**/