073263
To: vim_dev@googlegroups.com
073263
Subject: Patch 7.4.576
073263
Fcc: outbox
073263
From: Bram Moolenaar <Bram@moolenaar.net>
073263
Mime-Version: 1.0
073263
Content-Type: text/plain; charset=UTF-8
073263
Content-Transfer-Encoding: 8bit
073263
------------
073263
073263
Patch 7.4.576
073263
Problem:    Redrawing problem with 'relativenumber' and 'linebreak'.
073263
Solution:   Temporarily reset 'linebreak' and restore it in more places.
073263
	    (Christian Brabandt)
073263
Files:	    src/normal.c
073263
073263
073263
*** ../vim-7.4.575/src/normal.c	2014-10-31 13:54:21.843214469 +0100
073263
--- src/normal.c	2015-01-14 17:49:38.320915425 +0100
073263
***************
073263
*** 1393,1402 ****
073263
      int		    include_line_break = FALSE;
073263
  #endif
073263
  
073263
- #ifdef FEAT_LINEBREAK
073263
-     curwin->w_p_lbr = FALSE;	/* Avoid a problem with unwanted linebreaks in
073263
- 				 * block mode. */
073263
- #endif
073263
  #if defined(FEAT_CLIPBOARD)
073263
      /*
073263
       * Yank the visual area into the GUI selection register before we operate
073263
--- 1393,1398 ----
073263
***************
073263
*** 1420,1425 ****
073263
--- 1416,1425 ----
073263
       */
073263
      if ((finish_op || VIsual_active) && oap->op_type != OP_NOP)
073263
      {
073263
+ #ifdef FEAT_LINEBREAK
073263
+ 	/* Avoid a problem with unwanted linebreaks in block mode. */
073263
+ 	curwin->w_p_lbr = FALSE;
073263
+ #endif
073263
  	oap->is_VIsual = VIsual_active;
073263
  	if (oap->motion_force == 'V')
073263
  	    oap->motion_type = MLINE;
073263
***************
073263
*** 1819,1825 ****
073263
--- 1819,1831 ----
073263
  			    || oap->op_type == OP_FUNCTION
073263
  			    || oap->op_type == OP_FILTER)
073263
  			&& oap->motion_force == NUL)
073263
+ 		{
073263
+ #ifdef FEAT_LINEBREAK
073263
+ 		    /* make sure redrawing is correct */
073263
+ 		    curwin->w_p_lbr = lbr_saved;
073263
+ #endif
073263
  		    redraw_curbuf_later(INVERTED);
073263
+ 		}
073263
  	    }
073263
  	}
073263
  
073263
***************
073263
*** 1863,1869 ****
073263
--- 1869,1880 ----
073263
  		    || oap->op_type == OP_FOLD
073263
  #endif
073263
  		    ))
073263
+ 	{
073263
+ #ifdef FEAT_LINEBREAK
073263
+ 	    curwin->w_p_lbr = lbr_saved;
073263
+ #endif
073263
  	    redraw_curbuf_later(INVERTED);
073263
+ 	}
073263
  
073263
  	/*
073263
  	 * If the end of an operator is in column one while oap->motion_type
073263
***************
073263
*** 1947,1953 ****
073263
--- 1958,1969 ----
073263
  		}
073263
  	    }
073263
  	    else
073263
+ 	    {
073263
+ #ifdef FEAT_LINEBREAK
073263
+ 		curwin->w_p_lbr = lbr_saved;
073263
+ #endif
073263
  		(void)op_yank(oap, FALSE, !gui_yank);
073263
+ 	    }
073263
  	    check_cursor_col();
073263
  	    break;
073263
  
073263
***************
073263
*** 1969,1974 ****
073263
--- 1985,1995 ----
073263
  		else
073263
  		    restart_edit_save = 0;
073263
  		restart_edit = 0;
073263
+ #ifdef FEAT_LINEBREAK
073263
+ 		/* Restore linebreak, so that when the user edits it looks as
073263
+ 		 * before. */
073263
+ 		curwin->w_p_lbr = lbr_saved;
073263
+ #endif
073263
  		/* Reset finish_op now, don't want it set inside edit(). */
073263
  		finish_op = FALSE;
073263
  		if (op_change(oap))	/* will call edit() */
073263
***************
073263
*** 2064,2071 ****
073263
  		 * Visual mode.  But do this only once. */
073263
  		restart_edit_save = restart_edit;
073263
  		restart_edit = 0;
073263
! 
073263
  		op_insert(oap, cap->count1);
073263
  
073263
  		/* TODO: when inserting in several lines, should format all
073263
  		 * the lines. */
073263
--- 2085,2100 ----
073263
  		 * Visual mode.  But do this only once. */
073263
  		restart_edit_save = restart_edit;
073263
  		restart_edit = 0;
073263
! #ifdef FEAT_LINEBREAK
073263
! 		/* Restore linebreak, so that when the user edits it looks as
073263
! 		 * before. */
073263
! 		curwin->w_p_lbr = lbr_saved;
073263
! #endif
073263
  		op_insert(oap, cap->count1);
073263
+ #ifdef FEAT_LINEBREAK
073263
+ 		/* Reset linebreak, so that formatting works correctly. */
073263
+ 		curwin->w_p_lbr = FALSE;
073263
+ #endif
073263
  
073263
  		/* TODO: when inserting in several lines, should format all
073263
  		 * the lines. */
073263
***************
073263
*** 2090,2096 ****
073263
--- 2119,2132 ----
073263
  	    }
073263
  #ifdef FEAT_VISUALEXTRA
073263
  	    else
073263
+ 	    {
073263
+ #ifdef FEAT_LINEBREAK
073263
+ 		/* Restore linebreak, so that when the user edits it looks as
073263
+ 		 * before. */
073263
+ 		curwin->w_p_lbr = lbr_saved;
073263
+ #endif
073263
  		op_replace(oap, cap->nchar);
073263
+ 	    }
073263
  #endif
073263
  	    break;
073263
  
073263
***************
073263
*** 2134,2140 ****
073263
--- 2170,2181 ----
073263
  	    if (!p_sol && oap->motion_type == MLINE && !oap->end_adjusted
073263
  		    && (oap->op_type == OP_LSHIFT || oap->op_type == OP_RSHIFT
073263
  						|| oap->op_type == OP_DELETE))
073263
+ 	    {
073263
+ #ifdef FEAT_LINEBREAK
073263
+ 		curwin->w_p_lbr = FALSE;
073263
+ #endif
073263
  		coladvance(curwin->w_curswant = old_col);
073263
+ 	    }
073263
  	}
073263
  	else
073263
  	{
073263
*** ../vim-7.4.575/src/version.c	2015-01-14 17:40:04.407125696 +0100
073263
--- src/version.c	2015-01-14 17:47:45.898132017 +0100
073263
***************
073263
*** 743,744 ****
073263
--- 743,746 ----
073263
  {   /* Add new patch number below this line */
073263
+ /**/
073263
+     576,
073263
  /**/
073263
073263
-- 
073263
From "know your smileys":
073263
 :-H	Is missing teeth
073263
073263
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
073263
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
073263
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
073263
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///