Karsten Hopp f384ad
To: vim_dev@googlegroups.com
Karsten Hopp f384ad
Subject: Patch 7.4.818
Karsten Hopp f384ad
Fcc: outbox
Karsten Hopp f384ad
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp f384ad
Mime-Version: 1.0
Karsten Hopp f384ad
Content-Type: text/plain; charset=UTF-8
Karsten Hopp f384ad
Content-Transfer-Encoding: 8bit
Karsten Hopp f384ad
------------
Karsten Hopp f384ad
Karsten Hopp f384ad
Patch 7.4.818
Karsten Hopp f384ad
Problem:    'linebreak' breaks c% if the last Visual selection was block.
Karsten Hopp f384ad
            (Chris Morganiser, Issue 389)
Karsten Hopp f384ad
Solution:   Handle Visual block mode differently. (Christian Brabandt)
Karsten Hopp f384ad
Files:      src/normal.c, src/testdir/test_listlbr.in,
Karsten Hopp f384ad
            src/testdir/test_listlbr.ok
Karsten Hopp f384ad
Karsten Hopp f384ad
Karsten Hopp f384ad
*** ../vim-7.4.817/src/normal.c	2015-08-04 19:18:46.044825907 +0200
Karsten Hopp f384ad
--- src/normal.c	2015-08-11 17:39:51.777194300 +0200
Karsten Hopp f384ad
***************
Karsten Hopp f384ad
*** 9583,9602 ****
Karsten Hopp f384ad
  #endif
Karsten Hopp f384ad
  
Karsten Hopp f384ad
  /*
Karsten Hopp f384ad
!  * calculate start/end virtual columns for operating in block mode
Karsten Hopp f384ad
   */
Karsten Hopp f384ad
      static void
Karsten Hopp f384ad
  get_op_vcol(oap, redo_VIsual_vcol, initial)
Karsten Hopp f384ad
      oparg_T	*oap;
Karsten Hopp f384ad
      colnr_T	redo_VIsual_vcol;
Karsten Hopp f384ad
!     int		initial;            /* when true: adjust position for 'selectmode' */
Karsten Hopp f384ad
  {
Karsten Hopp f384ad
      colnr_T	    start, end;
Karsten Hopp f384ad
  
Karsten Hopp f384ad
!     if (VIsual_mode != Ctrl_V)
Karsten Hopp f384ad
  	return;
Karsten Hopp f384ad
  
Karsten Hopp f384ad
!     oap->block_mode = TRUE;
Karsten Hopp f384ad
  
Karsten Hopp f384ad
  #ifdef FEAT_MBYTE
Karsten Hopp f384ad
      /* prevent from moving onto a trail byte */
Karsten Hopp f384ad
--- 9583,9603 ----
Karsten Hopp f384ad
  #endif
Karsten Hopp f384ad
  
Karsten Hopp f384ad
  /*
Karsten Hopp f384ad
!  * Calculate start/end virtual columns for operating in block mode.
Karsten Hopp f384ad
   */
Karsten Hopp f384ad
      static void
Karsten Hopp f384ad
  get_op_vcol(oap, redo_VIsual_vcol, initial)
Karsten Hopp f384ad
      oparg_T	*oap;
Karsten Hopp f384ad
      colnr_T	redo_VIsual_vcol;
Karsten Hopp f384ad
!     int		initial;    /* when TRUE adjust position for 'selectmode' */
Karsten Hopp f384ad
  {
Karsten Hopp f384ad
      colnr_T	    start, end;
Karsten Hopp f384ad
  
Karsten Hopp f384ad
!     if (VIsual_mode != Ctrl_V
Karsten Hopp f384ad
! 	    || (!initial && oap->end.col < W_WIDTH(curwin)))
Karsten Hopp f384ad
  	return;
Karsten Hopp f384ad
  
Karsten Hopp f384ad
!     oap->block_mode = VIsual_active;
Karsten Hopp f384ad
  
Karsten Hopp f384ad
  #ifdef FEAT_MBYTE
Karsten Hopp f384ad
      /* prevent from moving onto a trail byte */
Karsten Hopp f384ad
*** ../vim-7.4.817/src/testdir/test_listlbr.in	2015-07-28 11:21:27.045407225 +0200
Karsten Hopp f384ad
--- src/testdir/test_listlbr.in	2015-08-11 17:34:36.084926763 +0200
Karsten Hopp f384ad
***************
Karsten Hopp f384ad
*** 80,85 ****
Karsten Hopp f384ad
--- 80,92 ----
Karsten Hopp f384ad
  aaa
Karsten Hopp f384ad
  aaa
Karsten Hopp f384ad
  a?2k?2j~e.
Karsten Hopp f384ad
+ :let g:test ="Test 10: using normal commands after block-visual"
Karsten Hopp f384ad
+ :$put =g:test
Karsten Hopp f384ad
+ :set linebreak
Karsten Hopp f384ad
+ Go
Karsten Hopp f384ad
+ abcd{ef
Karsten Hopp f384ad
+ ghijklm
Karsten Hopp f384ad
+ no}pqrs?2k0f{??c%?
Karsten Hopp f384ad
  :%w! test.out
Karsten Hopp f384ad
  :qa!
Karsten Hopp f384ad
  ENDTEST
Karsten Hopp f384ad
*** ../vim-7.4.817/src/testdir/test_listlbr.ok	2015-07-28 11:21:27.045407225 +0200
Karsten Hopp f384ad
--- src/testdir/test_listlbr.ok	2015-08-11 17:34:36.084926763 +0200
Karsten Hopp f384ad
***************
Karsten Hopp f384ad
*** 46,48 ****
Karsten Hopp f384ad
--- 46,51 ----
Karsten Hopp f384ad
  AaA
Karsten Hopp f384ad
  AaA
Karsten Hopp f384ad
  A
Karsten Hopp f384ad
+ Test 10: using normal commands after block-visual
Karsten Hopp f384ad
+ 
Karsten Hopp f384ad
+ abcdpqrs
Karsten Hopp f384ad
*** ../vim-7.4.817/src/version.c	2015-08-11 16:19:59.433200370 +0200
Karsten Hopp f384ad
--- src/version.c	2015-08-11 17:46:09.644735306 +0200
Karsten Hopp f384ad
***************
Karsten Hopp f384ad
*** 743,744 ****
Karsten Hopp f384ad
--- 743,746 ----
Karsten Hopp f384ad
  {   /* Add new patch number below this line */
Karsten Hopp f384ad
+ /**/
Karsten Hopp f384ad
+     818,
Karsten Hopp f384ad
  /**/
Karsten Hopp f384ad
Karsten Hopp f384ad
-- 
Karsten Hopp f384ad
ARTHUR:  Be quiet!
Karsten Hopp f384ad
DENNIS:  --but by a two-thirds majority in the case of more--
Karsten Hopp f384ad
ARTHUR:  Be quiet!  I order you to be quiet!
Karsten Hopp f384ad
WOMAN:   Order, eh -- who does he think he is?
Karsten Hopp f384ad
ARTHUR:  I am your king!
Karsten Hopp f384ad
                                  The Quest for the Holy Grail (Monty Python)
Karsten Hopp f384ad
Karsten Hopp f384ad
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp f384ad
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp f384ad
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp f384ad
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///