diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2020-02-20 23:50:44 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-20 23:50:44 -0800 |
commit | c8ea09248bc9a801ce79d9ef40dffcabeb156ec2 (patch) | |
tree | f94142cf8e46ebb37c430967e8fe09e3098dd91c /src/nvim/screen.c | |
parent | 9897ad3606a780c764ed7382a80425af613a7c63 (diff) | |
parent | 7ed4837298414488e238763953d40a4c7f2d7976 (diff) | |
download | rneovim-c8ea09248bc9a801ce79d9ef40dffcabeb156ec2.tar.gz rneovim-c8ea09248bc9a801ce79d9ef40dffcabeb156ec2.tar.bz2 rneovim-c8ea09248bc9a801ce79d9ef40dffcabeb156ec2.zip |
Merge #11914 'vim-patch:8.1.{1122,1868}'
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; |