diff options
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 c4db9f8cae..0e930776c7 100644 --- a/src/charset.c +++ b/src/charset.c @@ -743,13 +743,13 @@ win_chartabsize(win_T *wp, char_u *p, colnr_T col) * Does not handle text properties, since "s" is not a buffer line. */ int -linetabsize(char_u *s) +linetabsize_str(char_u *s) { return linetabsize_col(0, s); } /* - * Like linetabsize(), but "s" starts at column "startcol". + * Like linetabsize_str(), but "s" starts at column "startcol". */ int linetabsize_col(int startcol, char_u *s) @@ -772,7 +772,7 @@ linetabsize_col(int startcol, char_u *s) } /* - * Like linetabsize(), but for a given window instead of the current one. + * Like linetabsize_str(), but for a given window instead of the current one. */ int win_linetabsize(win_T *wp, linenr_T lnum, char_u *line, colnr_T len) @@ -785,6 +785,17 @@ win_linetabsize(win_T *wp, linenr_T lnum, char_u *line, colnr_T len) return (int)cts.cts_vcol; } +/* + * Return the number of cells line "lnum" of window "wp" will take on the + * screen, taking into account the size of a tab and text properties. + */ + int +linetabsize(win_T *wp, linenr_T lnum) +{ + return win_linetabsize(wp, lnum, + ml_get_buf(wp->w_buffer, lnum, FALSE), (colnr_T)MAXCOL); +} + void win_linetabsize_cts(chartabsize_T *cts, colnr_T len) { |