Blame SOURCES/7.4.576

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