Karsten Hopp 6fa223
To: vim_dev@googlegroups.com
Karsten Hopp 6fa223
Subject: Patch 7.4.467
Karsten Hopp 6fa223
Fcc: outbox
Karsten Hopp 6fa223
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 6fa223
Mime-Version: 1.0
Karsten Hopp 6fa223
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 6fa223
Content-Transfer-Encoding: 8bit
Karsten Hopp 6fa223
------------
Karsten Hopp 6fa223
Karsten Hopp 6fa223
Patch 7.4.467
Karsten Hopp 6fa223
Problem:    'linebreak' does not work well together with Visual mode.
Karsten Hopp 6fa223
Solution:   Disable 'linebreak' while applying an operator.  Fix the test.
Karsten Hopp 6fa223
	    (Christian Brabandt)
Karsten Hopp 6fa223
Files:	    src/normal.c, src/screen.c, src/testdir/test_listlbr.in,
Karsten Hopp 6fa223
	    src/testdir/test_listlbr.ok
Karsten Hopp 6fa223
Karsten Hopp 6fa223
Karsten Hopp 6fa223
*** ../vim-7.4.466/src/normal.c	2014-08-30 13:32:03.406623315 +0200
Karsten Hopp 6fa223
--- src/normal.c	2014-10-09 13:17:59.264886376 +0200
Karsten Hopp 6fa223
***************
Karsten Hopp 6fa223
*** 1380,1385 ****
Karsten Hopp 6fa223
--- 1380,1391 ----
Karsten Hopp 6fa223
      pos_T	old_cursor;
Karsten Hopp 6fa223
      int		empty_region_error;
Karsten Hopp 6fa223
      int		restart_edit_save;
Karsten Hopp 6fa223
+ #ifdef FEAT_LINEBREAK
Karsten Hopp 6fa223
+     int		lbr_saved = curwin->w_p_lbr;
Karsten Hopp 6fa223
+ 
Karsten Hopp 6fa223
+     curwin->w_p_lbr = FALSE;	/* avoid a problem with unwanted linebreaks in
Karsten Hopp 6fa223
+ 				 * block mode */
Karsten Hopp 6fa223
+ #endif
Karsten Hopp 6fa223
  
Karsten Hopp 6fa223
      /* The visual area is remembered for redo */
Karsten Hopp 6fa223
      static int	    redo_VIsual_mode = NUL; /* 'v', 'V', or Ctrl-V */
Karsten Hopp 6fa223
***************
Karsten Hopp 6fa223
*** 2136,2141 ****
Karsten Hopp 6fa223
--- 2142,2150 ----
Karsten Hopp 6fa223
  	oap->block_mode = FALSE;
Karsten Hopp 6fa223
  	clearop(oap);
Karsten Hopp 6fa223
      }
Karsten Hopp 6fa223
+ #ifdef FEAT_LINEBREAK
Karsten Hopp 6fa223
+     curwin->w_p_lbr = lbr_saved;
Karsten Hopp 6fa223
+ #endif
Karsten Hopp 6fa223
  }
Karsten Hopp 6fa223
  
Karsten Hopp 6fa223
  /*
Karsten Hopp 6fa223
*** ../vim-7.4.466/src/screen.c	2014-08-29 12:08:39.686423658 +0200
Karsten Hopp 6fa223
--- src/screen.c	2014-10-09 13:18:52.868886493 +0200
Karsten Hopp 6fa223
***************
Karsten Hopp 6fa223
*** 1584,1592 ****
Karsten Hopp 6fa223
  	     */
Karsten Hopp 6fa223
  	    if (VIsual_mode == Ctrl_V)
Karsten Hopp 6fa223
  	    {
Karsten Hopp 6fa223
! 		colnr_T	fromc, toc;
Karsten Hopp 6fa223
  
Karsten Hopp 6fa223
  		getvcols(wp, &VIsual, &curwin->w_cursor, &fromc, &toc;;
Karsten Hopp 6fa223
  		++toc;
Karsten Hopp 6fa223
  		if (curwin->w_curswant == MAXCOL)
Karsten Hopp 6fa223
  		    toc = MAXCOL;
Karsten Hopp 6fa223
--- 1584,1600 ----
Karsten Hopp 6fa223
  	     */
Karsten Hopp 6fa223
  	    if (VIsual_mode == Ctrl_V)
Karsten Hopp 6fa223
  	    {
Karsten Hopp 6fa223
! 		colnr_T	    fromc, toc;
Karsten Hopp 6fa223
! #if defined(FEAT_VIRTUALEDIT) && defined(FEAT_LINEBREAK)
Karsten Hopp 6fa223
! 		int	    save_ve_flags = ve_flags;
Karsten Hopp 6fa223
  
Karsten Hopp 6fa223
+ 		if (curwin->w_p_lbr)
Karsten Hopp 6fa223
+ 		    ve_flags = VE_ALL;
Karsten Hopp 6fa223
+ #endif
Karsten Hopp 6fa223
  		getvcols(wp, &VIsual, &curwin->w_cursor, &fromc, &toc;;
Karsten Hopp 6fa223
+ #if defined(FEAT_VIRTUALEDIT) && defined(FEAT_LINEBREAK)
Karsten Hopp 6fa223
+ 		ve_flags = save_ve_flags;
Karsten Hopp 6fa223
+ #endif
Karsten Hopp 6fa223
  		++toc;
Karsten Hopp 6fa223
  		if (curwin->w_curswant == MAXCOL)
Karsten Hopp 6fa223
  		    toc = MAXCOL;
Karsten Hopp 6fa223
*** ../vim-7.4.466/src/testdir/test_listlbr.in	2014-08-30 18:10:15.106659776 +0200
Karsten Hopp 6fa223
--- src/testdir/test_listlbr.in	2014-10-09 13:16:33.072886187 +0200
Karsten Hopp 6fa223
***************
Karsten Hopp 6fa223
*** 2,8 ****
Karsten Hopp 6fa223
  
Karsten Hopp 6fa223
  STARTTEST
Karsten Hopp 6fa223
  :so small.vim
Karsten Hopp 6fa223
! :if !exists("+linebreak") || !exists("+conceal") | e! test.ok | w! test.out | qa! | endif
Karsten Hopp 6fa223
  :10new|:vsp|:vert resize 20
Karsten Hopp 6fa223
  :put =\"\tabcdef hijklmn\tpqrstuvwxyz_1060ABCDEFGHIJKLMNOP \"
Karsten Hopp 6fa223
  :norm! zt
Karsten Hopp 6fa223
--- 2,8 ----
Karsten Hopp 6fa223
  
Karsten Hopp 6fa223
  STARTTEST
Karsten Hopp 6fa223
  :so small.vim
Karsten Hopp 6fa223
! :if !exists("+linebreak") || !has("conceal") | e! test.ok | w! test.out | qa! | endif
Karsten Hopp 6fa223
  :10new|:vsp|:vert resize 20
Karsten Hopp 6fa223
  :put =\"\tabcdef hijklmn\tpqrstuvwxyz_1060ABCDEFGHIJKLMNOP \"
Karsten Hopp 6fa223
  :norm! zt
Karsten Hopp 6fa223
***************
Karsten Hopp 6fa223
*** 56,61 ****
Karsten Hopp 6fa223
--- 56,69 ----
Karsten Hopp 6fa223
  :syn match All /.*/ contains=ConcealVar
Karsten Hopp 6fa223
  :let line=ScreenChar(winwidth(0))
Karsten Hopp 6fa223
  :call DoRecordScreen()
Karsten Hopp 6fa223
+ :set cpo&vim linebreak
Karsten Hopp 6fa223
+ :let g:test ="Test 6: set linebreak with visual block mode"
Karsten Hopp 6fa223
+ :let line="REMOVE: this not"
Karsten Hopp 6fa223
+ :$put =line
Karsten Hopp 6fa223
+ :let line="REMOVE: aaaaaaaaaaaaa"
Karsten Hopp 6fa223
+ :$put =line
Karsten Hopp 6fa223
+ :1/^REMOVE:
Karsten Hopp 6fa223
+ 0?jf x:$put
Karsten Hopp 6fa223
  :%w! test.out
Karsten Hopp 6fa223
  :qa!
Karsten Hopp 6fa223
  ENDTEST
Karsten Hopp 6fa223
*** ../vim-7.4.466/src/testdir/test_listlbr.ok	2014-08-29 12:08:39.686423658 +0200
Karsten Hopp 6fa223
--- src/testdir/test_listlbr.ok	2014-10-09 13:16:33.072886187 +0200
Karsten Hopp 6fa223
***************
Karsten Hopp 6fa223
*** 32,34 ****
Karsten Hopp 6fa223
--- 32,38 ----
Karsten Hopp 6fa223
  ~                   
Karsten Hopp 6fa223
  ~                   
Karsten Hopp 6fa223
  ~                   
Karsten Hopp 6fa223
+ this not
Karsten Hopp 6fa223
+ aaaaaaaaaaaaa
Karsten Hopp 6fa223
+ REMOVE: 
Karsten Hopp 6fa223
+ REMOVE: 
Karsten Hopp 6fa223
*** ../vim-7.4.466/src/version.c	2014-10-09 10:44:33.196866267 +0200
Karsten Hopp 6fa223
--- src/version.c	2014-10-09 13:16:44.976886213 +0200
Karsten Hopp 6fa223
***************
Karsten Hopp 6fa223
*** 743,744 ****
Karsten Hopp 6fa223
--- 743,746 ----
Karsten Hopp 6fa223
  {   /* Add new patch number below this line */
Karsten Hopp 6fa223
+ /**/
Karsten Hopp 6fa223
+     467,
Karsten Hopp 6fa223
  /**/
Karsten Hopp 6fa223
Karsten Hopp 6fa223
-- 
Karsten Hopp 6fa223
"Marriage is a wonderful institution...
Karsten Hopp 6fa223
but who wants to live in an institution?"
Karsten Hopp 6fa223
 - Groucho Marx
Karsten Hopp 6fa223
Karsten Hopp 6fa223
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 6fa223
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 6fa223
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 6fa223
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///