Karsten Hopp fcc823
To: vim_dev@googlegroups.com
Karsten Hopp fcc823
Subject: Patch 7.4.219
Karsten Hopp fcc823
Fcc: outbox
Karsten Hopp fcc823
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp fcc823
Mime-Version: 1.0
Karsten Hopp fcc823
Content-Type: text/plain; charset=UTF-8
Karsten Hopp fcc823
Content-Transfer-Encoding: 8bit
Karsten Hopp fcc823
------------
Karsten Hopp fcc823
Karsten Hopp fcc823
Patch 7.4.219
Karsten Hopp fcc823
Problem:    When 'relativenumber' or 'cursorline' are set the window is
Karsten Hopp fcc823
	    redrawn much to often. (Patrick Hemmer, Dominique Pelle)
Karsten Hopp fcc823
Solution:   Check the VALID_CROW flag instead of VALID_WROW.
Karsten Hopp fcc823
Files:	    src/move.c
Karsten Hopp fcc823
Karsten Hopp fcc823
Karsten Hopp fcc823
*** ../vim-7.4.218/src/move.c	2014-03-23 15:12:29.927264336 +0100
Karsten Hopp fcc823
--- src/move.c	2014-03-27 11:59:28.524382473 +0100
Karsten Hopp fcc823
***************
Karsten Hopp fcc823
*** 772,777 ****
Karsten Hopp fcc823
--- 772,791 ----
Karsten Hopp fcc823
  	}
Karsten Hopp fcc823
      }
Karsten Hopp fcc823
  
Karsten Hopp fcc823
+     /* Redraw when w_cline_row changes and 'relativenumber' or 'cursorline' is
Karsten Hopp fcc823
+      * set. */
Karsten Hopp fcc823
+     if ((curwin->w_p_rnu
Karsten Hopp fcc823
+ #ifdef FEAT_SYN_HL
Karsten Hopp fcc823
+ 		|| curwin->w_p_cul
Karsten Hopp fcc823
+ #endif
Karsten Hopp fcc823
+ 		)
Karsten Hopp fcc823
+ 	    && (curwin->w_valid & VALID_CROW) == 0
Karsten Hopp fcc823
+ # ifdef FEAT_INS_EXPAND
Karsten Hopp fcc823
+ 	    && !pum_visible()
Karsten Hopp fcc823
+ # endif
Karsten Hopp fcc823
+ 	    )
Karsten Hopp fcc823
+ 	redraw_later(SOME_VALID);
Karsten Hopp fcc823
+ 
Karsten Hopp fcc823
      wp->w_valid |= VALID_CROW|VALID_CHEIGHT;
Karsten Hopp fcc823
  
Karsten Hopp fcc823
      /* validate botline too, if update_screen doesn't do it */
Karsten Hopp fcc823
***************
Karsten Hopp fcc823
*** 1172,1193 ****
Karsten Hopp fcc823
      if (prev_skipcol != curwin->w_skipcol)
Karsten Hopp fcc823
  	redraw_later(NOT_VALID);
Karsten Hopp fcc823
  
Karsten Hopp fcc823
-     /* Redraw when w_row changes and 'relativenumber' is set */
Karsten Hopp fcc823
-     if (((curwin->w_valid & VALID_WROW) == 0 && (curwin->w_p_rnu
Karsten Hopp fcc823
  #ifdef FEAT_SYN_HL
Karsten Hopp fcc823
! 	/* or when w_row changes and 'cursorline' is set. */
Karsten Hopp fcc823
! 						|| curwin->w_p_cul
Karsten Hopp fcc823
! #endif
Karsten Hopp fcc823
! 	))
Karsten Hopp fcc823
! #ifdef FEAT_SYN_HL
Karsten Hopp fcc823
! 	/* or when w_virtcol changes and 'cursorcolumn' is set */
Karsten Hopp fcc823
! 	|| (curwin->w_p_cuc && (curwin->w_valid & VALID_VIRTCOL) == 0)
Karsten Hopp fcc823
! #endif
Karsten Hopp fcc823
! 	)
Karsten Hopp fcc823
  # ifdef FEAT_INS_EXPAND
Karsten Hopp fcc823
! 	    if (!pum_visible())
Karsten Hopp fcc823
  # endif
Karsten Hopp fcc823
! 		redraw_later(SOME_VALID);
Karsten Hopp fcc823
  
Karsten Hopp fcc823
      curwin->w_valid |= VALID_WCOL|VALID_WROW|VALID_VIRTCOL;
Karsten Hopp fcc823
  }
Karsten Hopp fcc823
--- 1186,1200 ----
Karsten Hopp fcc823
      if (prev_skipcol != curwin->w_skipcol)
Karsten Hopp fcc823
  	redraw_later(NOT_VALID);
Karsten Hopp fcc823
  
Karsten Hopp fcc823
  #ifdef FEAT_SYN_HL
Karsten Hopp fcc823
!     /* Redraw when w_virtcol changes and 'cursorcolumn' is set */
Karsten Hopp fcc823
!     if (curwin->w_p_cuc && (curwin->w_valid & VALID_VIRTCOL) == 0
Karsten Hopp fcc823
  # ifdef FEAT_INS_EXPAND
Karsten Hopp fcc823
! 	    && !pum_visible()
Karsten Hopp fcc823
  # endif
Karsten Hopp fcc823
! 	)
Karsten Hopp fcc823
! 	redraw_later(SOME_VALID);
Karsten Hopp fcc823
! #endif
Karsten Hopp fcc823
  
Karsten Hopp fcc823
      curwin->w_valid |= VALID_WCOL|VALID_WROW|VALID_VIRTCOL;
Karsten Hopp fcc823
  }
Karsten Hopp fcc823
*** ../vim-7.4.218/src/version.c	2014-03-25 18:23:27.062087691 +0100
Karsten Hopp fcc823
--- src/version.c	2014-03-27 12:11:15.276393302 +0100
Karsten Hopp fcc823
***************
Karsten Hopp fcc823
*** 736,737 ****
Karsten Hopp fcc823
--- 736,739 ----
Karsten Hopp fcc823
  {   /* Add new patch number below this line */
Karsten Hopp fcc823
+ /**/
Karsten Hopp fcc823
+     219,
Karsten Hopp fcc823
  /**/
Karsten Hopp fcc823
Karsten Hopp fcc823
-- 
Karsten Hopp fcc823
The only way the average employee can speak to an executive is by taking a
Karsten Hopp fcc823
second job as a golf caddie.
Karsten Hopp fcc823
				(Scott Adams - The Dilbert principle)
Karsten Hopp fcc823
Karsten Hopp fcc823
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp fcc823
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp fcc823
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp fcc823
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///