diff options
Diffstat (limited to 'src/nvim/screen.c')
-rw-r--r-- | src/nvim/screen.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 5df279c0a7..b6da02d9c3 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -3647,8 +3647,9 @@ win_line ( tab_len += n_extra - tab_len; } - /* if n_extra > 0, it gives the number of chars to use for - * a tab, else we need to calculate the width for a tab */ + // if n_extra > 0, it gives the number of chars + // to use for a tab, else we need to calculate the width + // for a tab int len = (tab_len * mb_char2len(wp->w_p_lcs_chars.tab2)); if (n_extra > 0) { len += n_extra - tab_len; @@ -3660,10 +3661,16 @@ win_line ( xfree(p_extra_free); p_extra_free = p; for (i = 0; i < tab_len; i++) { - utf_char2bytes(wp->w_p_lcs_chars.tab2, p); - p += mb_char2len(wp->w_p_lcs_chars.tab2); - n_extra += mb_char2len(wp->w_p_lcs_chars.tab2) - - (saved_nextra > 0 ? 1: 0); + int lcs = wp->w_p_lcs_chars.tab2; + + // if tab3 is given, need to change the char + // for tab + if (wp->w_p_lcs_chars.tab3 && i == tab_len - 1) { + lcs = wp->w_p_lcs_chars.tab3; + } + utf_char2bytes(lcs, p); + p += mb_char2len(lcs); + n_extra += mb_char2len(lcs) - (saved_nextra > 0 ? 1 : 0); } p_extra = p_extra_free; |