073263
To: vim_dev@googlegroups.com
073263
Subject: Patch 7.4.478
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.478
073263
Problem:    Using byte length instead of character length for 'showbreak'.
073263
Solution:   Compute the character length. (Marco Hinz)
073263
Files:	    src/charset.c
073263
073263
073263
*** ../vim-7.4.477/src/charset.c	2014-10-10 15:34:29.657092994 +0200
073263
--- src/charset.c	2014-10-15 21:24:05.578082450 +0200
073263
***************
073263
*** 1184,1191 ****
073263
  	{
073263
  	    col -= W_WIDTH(wp);
073263
  	    numberextra = W_WIDTH(wp) - (numberextra - win_col_off2(wp));
073263
! 	    if (*p_sbr != NUL && col >= (colnr_T)STRLEN(p_sbr))
073263
! 		col -= (colnr_T)STRLEN(p_sbr);
073263
  	    if (numberextra > 0)
073263
  		col = col % numberextra;
073263
  	}
073263
--- 1184,1195 ----
073263
  	{
073263
  	    col -= W_WIDTH(wp);
073263
  	    numberextra = W_WIDTH(wp) - (numberextra - win_col_off2(wp));
073263
! 	    if (*p_sbr != NUL)
073263
! 	    {
073263
! 		colnr_T sbrlen = (colnr_T)MB_CHARLEN(p_sbr);
073263
! 		if (col >= sbrlen)
073263
! 		    col -= sbrlen;
073263
! 	    }
073263
  	    if (numberextra > 0)
073263
  		col = col % numberextra;
073263
  	}
073263
*** ../vim-7.4.477/src/version.c	2014-10-15 12:56:44.006015955 +0200
073263
--- src/version.c	2014-10-15 21:19:10.414081805 +0200
073263
***************
073263
*** 743,744 ****
073263
--- 743,746 ----
073263
  {   /* Add new patch number below this line */
073263
+ /**/
073263
+     478,
073263
  /**/
073263
073263
-- 
073263
There is a fine line between courage and foolishness.
073263
Unfortunately, it's not a fence.
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    ///