diff src/charset.c @ 2339:01e4b4d37842 vim73

Added strdisplaywidth() function.
author Bram Moolenaar <bram@vim.org>
date Sun, 18 Jul 2010 15:45:49 +0200
parents 3cdf2a653e00
children 8a156630208b
line wrap: on
line diff
--- a/src/charset.c
+++ b/src/charset.c
@@ -839,14 +839,25 @@ win_chartabsize(wp, p, col)
 #endif
 
 /*
- * return the number of characters the string 's' will take on the screen,
- * taking into account the size of a tab
+ * Return the number of characters the string 's' will take on the screen,
+ * taking into account the size of a tab.
  */
     int
 linetabsize(s)
     char_u	*s;
 {
-    colnr_T	col = 0;
+    return linetabsize_col(0, s);
+}
+
+/*
+ * Like linetabsize(), but starting at column "startcol".
+ */
+    int
+linetabsize_col(startcol, s)
+    int		startcol;
+    char_u	*s;
+{
+    colnr_T	col = startcol;
 
     while (*s != NUL)
 	col += lbr_chartabsize_adv(&s, col);