diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-03-03 07:36:41 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2023-03-03 07:54:01 +0800 |
commit | a974d1511e20647b1e60015e6cdd456bd49f4718 (patch) | |
tree | f4f100ab19084288f80ba1320e4fb4e36da94f79 | |
parent | 361de6d54d41fc0fc8f8a89ec779696f3f7bb46e (diff) | |
download | rneovim-a974d1511e20647b1e60015e6cdd456bd49f4718.tar.gz rneovim-a974d1511e20647b1e60015e6cdd456bd49f4718.tar.bz2 rneovim-a974d1511e20647b1e60015e6cdd456bd49f4718.zip |
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.
https://github.com/vim/vim/commit/a0789478f6ebbb823670b7e14ce13ea3fd3b0217
Co-authored-by: Bram Moolenaar <Bram@vim.org>
-rw-r--r-- | src/nvim/drawline.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c index bf8649afe0..6b24fe6b46 100644 --- a/src/nvim/drawline.c +++ b/src/nvim/drawline.c @@ -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; |