vim-patch:9.0.0690: buffer size for expanding tab not correctly computed

Problem:    Buffer size for expanding tab not correctly computed.
Solution:   Correctly use size of end character.

a0789478f6

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
zeertzjq 2023-03-03 07:36:41 +08:00
parent 361de6d54d
commit a974d1511e

View File

@ -2106,9 +2106,10 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool nochange,
// 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 * utf_char2len(wp->w_p_lcs_chars.tab2));
int tab2_len = utf_char2len(wp->w_p_lcs_chars.tab2);
int len = tab_len * tab2_len;
if (wp->w_p_lcs_chars.tab3) {
len += utf_char2len(wp->w_p_lcs_chars.tab3);
len += utf_char2len(wp->w_p_lcs_chars.tab3) - tab2_len;
}
if (n_extra > 0) {
len += n_extra - tab_len;