]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.0.0690: buffer size for expanding tab not correctly computed v9.0.0690
authorBram Moolenaar <Bram@vim.org>
Sat, 8 Oct 2022 10:16:40 +0000 (11:16 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 8 Oct 2022 10:16:40 +0000 (11:16 +0100)
Problem:    Buffer size for expanding tab not correctly computed.
Solution:   Correctly use size of end character.

src/drawline.c
src/version.c

index e7f9fabab10a2a0a779a073db27d5049e47a7e49..cddb6ab654cf932076e4d1d1e213575cb18ae572 100644 (file)
@@ -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;
index 1d60238469b2bc17842ef6b434709597c69c07b9..37046ba981d6bc4d232cda53c2cbea3b9e0f2d78 100644 (file)
@@ -699,6 +699,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    690,
 /**/
     689,
 /**/