3ef2ca
To: vim_dev@googlegroups.com
3ef2ca
Subject: Patch 7.4.425
3ef2ca
Fcc: outbox
3ef2ca
From: Bram Moolenaar <Bram@moolenaar.net>
3ef2ca
Mime-Version: 1.0
3ef2ca
Content-Type: text/plain; charset=UTF-8
3ef2ca
Content-Transfer-Encoding: 8bit
3ef2ca
------------
3ef2ca
3ef2ca
Patch 7.4.425
3ef2ca
Problem:    When 'showbreak' is used "gj" may move to the wrong position.
3ef2ca
	    (Nazri Ramliy)
3ef2ca
Solution:   Adjust virtcol when 'showbreak' is set. (Christian Brabandt)
3ef2ca
Files:	    src/normal.c
3ef2ca
3ef2ca
3ef2ca
*** ../vim-7.4.424/src/normal.c	2014-07-23 12:31:17.207990767 +0200
3ef2ca
--- src/normal.c	2014-08-29 14:15:14.158440247 +0200
3ef2ca
***************
3ef2ca
*** 4509,4521 ****
3ef2ca
  #if defined(FEAT_LINEBREAK) || defined(FEAT_MBYTE)
3ef2ca
      if (curwin->w_cursor.col > 0 && curwin->w_p_wrap)
3ef2ca
      {
3ef2ca
  	/*
3ef2ca
  	 * Check for landing on a character that got split at the end of the
3ef2ca
  	 * last line.  We want to advance a screenline, not end up in the same
3ef2ca
  	 * screenline or move two screenlines.
3ef2ca
  	 */
3ef2ca
  	validate_virtcol();
3ef2ca
! 	if (curwin->w_virtcol > curwin->w_curswant
3ef2ca
  		&& (curwin->w_curswant < (colnr_T)width1
3ef2ca
  		    ? (curwin->w_curswant > (colnr_T)width1 / 2)
3ef2ca
  		    : ((curwin->w_curswant - width1) % width2
3ef2ca
--- 4509,4527 ----
3ef2ca
  #if defined(FEAT_LINEBREAK) || defined(FEAT_MBYTE)
3ef2ca
      if (curwin->w_cursor.col > 0 && curwin->w_p_wrap)
3ef2ca
      {
3ef2ca
+ 	colnr_T virtcol;
3ef2ca
+ 
3ef2ca
  	/*
3ef2ca
  	 * Check for landing on a character that got split at the end of the
3ef2ca
  	 * last line.  We want to advance a screenline, not end up in the same
3ef2ca
  	 * screenline or move two screenlines.
3ef2ca
  	 */
3ef2ca
  	validate_virtcol();
3ef2ca
! 	virtcol = curwin->w_virtcol;
3ef2ca
! 	if (virtcol > (colnr_T)width1 && *p_sbr != NUL)
3ef2ca
! 	    virtcol -= vim_strsize(p_sbr);
3ef2ca
! 
3ef2ca
! 	if (virtcol > curwin->w_curswant
3ef2ca
  		&& (curwin->w_curswant < (colnr_T)width1
3ef2ca
  		    ? (curwin->w_curswant > (colnr_T)width1 / 2)
3ef2ca
  		    : ((curwin->w_curswant - width1) % width2
3ef2ca
*** ../vim-7.4.424/src/version.c	2014-08-29 13:49:48.678436915 +0200
3ef2ca
--- src/version.c	2014-08-29 14:17:26.938440537 +0200
3ef2ca
***************
3ef2ca
*** 743,744 ****
3ef2ca
--- 743,746 ----
3ef2ca
  {   /* Add new patch number below this line */
3ef2ca
+ /**/
3ef2ca
+     425,
3ef2ca
  /**/
3ef2ca
3ef2ca
-- 
3ef2ca
From "know your smileys":
3ef2ca
 !-|	I-am-a-Cylon-Centurian-with-one-red-eye-bouncing-back-and-forth
3ef2ca
3ef2ca
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
3ef2ca
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
3ef2ca
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
3ef2ca
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///