Mercurial > vim
diff src/drawline.c @ 30711:e1fbb6571b58 v9.0.0690
patch 9.0.0690: buffer size for expanding tab not correctly computed
Commit: https://github.com/vim/vim/commit/a0789478f6ebbb823670b7e14ce13ea3fd3b0217
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Oct 8 11:16:40 2022 +0100
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 08 Oct 2022 12:30:06 +0200 |
parents | a59a8ce13129 |
children | cb8094ff4f36 |
line wrap: on
line diff
--- a/src/drawline.c +++ b/src/drawline.c @@ -2805,9 +2805,10 @@ win_line( // If wlv.n_extra > 0, it gives the number of chars, to // use for a tab, else we need to calculate the width // for a tab. - len = (tab_len * mb_char2len(wp->w_lcs_chars.tab2)); + int tab2_len = mb_char2len(wp->w_lcs_chars.tab2); + len = tab_len * tab2_len; if (wp->w_lcs_chars.tab3) - len += mb_char2len(wp->w_lcs_chars.tab3); + len += mb_char2len(wp->w_lcs_chars.tab3) - tab2_len; if (wlv.n_extra > 0) len += wlv.n_extra - tab_len; c = wp->w_lcs_chars.tab1;