summaryrefslogtreecommitdiff
path: root/src/screen.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/screen.c')
-rw-r--r--src/screen.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/screen.c b/src/screen.c
index 36afc2dcd..e11bdc377 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -4456,6 +4456,10 @@ win_line(wp, lnum, startrow, endrow, nochange)
/* TODO: is passing p for start of the line OK? */
n_extra = win_lbr_chartabsize(wp, line, p, (colnr_T)vcol,
NULL) - 1;
+ if (c == TAB && n_extra + col > W_WIDTH(wp))
+ n_extra = (int)wp->w_buffer->b_p_ts
+ - vcol % (int)wp->w_buffer->b_p_ts - 1;
+
c_extra = ' ';
if (vim_iswhite(c))
{