diff options
author | Bram Moolenaar <Bram@vim.org> | 2010-07-18 15:45:49 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2010-07-18 15:45:49 +0200 |
commit | dc536095ac452c12e9bb4c69b473d28d51e8d4b9 (patch) | |
tree | c9cb78c565a0f42f5a82a519d9f191772831627d /src/charset.c | |
parent | 72597a57b526a8df333e77ef8a837b595baa18c7 (diff) | |
download | vim-git-dc536095ac452c12e9bb4c69b473d28d51e8d4b9.tar.gz |
Added strdisplaywidth() function.
Diffstat (limited to 'src/charset.c')
-rw-r--r-- | src/charset.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/charset.c b/src/charset.c index ef162e4a4..87ad30333 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); |