summaryrefslogtreecommitdiffstats
path: root/src/charset.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2010-07-18 15:45:49 +0200
committerBram Moolenaar <Bram@vim.org>2010-07-18 15:45:49 +0200
commitdc536095ac452c12e9bb4c69b473d28d51e8d4b9 (patch)
treec9cb78c565a0f42f5a82a519d9f191772831627d /src/charset.c
parent72597a57b526a8df333e77ef8a837b595baa18c7 (diff)
Added strdisplaywidth() function.
Diffstat (limited to 'src/charset.c')
-rw-r--r--src/charset.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/charset.c b/src/charset.c
index ef162e4a47..87ad303332 100644
--- 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);