0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

Added strdisplaywidth() function.

This commit is contained in:
Bram Moolenaar
2010-07-18 15:45:49 +02:00
parent 72597a57b5
commit dc536095ac
4 changed files with 50 additions and 7 deletions

View File

@@ -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);