diff src/screen.c @ 2338:da6ec32d8d8f vim73

Added strwidth() and strchars() functions.
author Bram Moolenaar <bram@vim.org>
date Sun, 18 Jul 2010 15:31:08 +0200
parents b13079093ae1
children b38c324bdc36
line wrap: on
line diff
--- a/src/screen.c
+++ b/src/screen.c
@@ -6168,8 +6168,8 @@ win_redr_status(wp)
 		int	clen = 0, i;
 
 		/* Count total number of display cells. */
-		for (i = 0; p[i] != NUL; i += (*mb_ptr2len)(p + i))
-		    clen += (*mb_ptr2cells)(p + i);
+		clen = mb_string2cells(p, -1);
+
 		/* Find first character that will fit.
 		 * Going from start to end is much faster for DBCS. */
 		for (i = 0; p[i] != NUL && clen >= this_ru_col - 1;