summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-10-08 11:16:40 +0100
committerBram Moolenaar <Bram@vim.org>2022-10-08 11:16:40 +0100
commita0789478f6ebbb823670b7e14ce13ea3fd3b0217 (patch)
tree475b7d6a7b011f0c6b9aae641a90227cdc2783a1
parentfcb86b0a99a9abedc408c99dae7591b6da832be8 (diff)
patch 9.0.0690: buffer size for expanding tab not correctly computedv9.0.0690
Problem: Buffer size for expanding tab not correctly computed. Solution: Correctly use size of end character.
-rw-r--r--src/drawline.c5
-rw-r--r--src/version.c2
2 files changed, 5 insertions, 2 deletions
diff --git a/src/drawline.c b/src/drawline.c
index e7f9fabab1..cddb6ab654 100644
--- 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;
diff --git a/src/version.c b/src/version.c
index 1d60238469..37046ba981 100644
--- a/src/version.c
+++ b/src/version.c
@@ -700,6 +700,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 690,
+/**/
689,
/**/
688,