1
0
forked from aniani/vim

patch 9.0.0131: virtual text with Tab is not displayed correctly

Problem:    Virtual text with Tab is not displayed correctly.
Solution:   Change any Tab to a space.
This commit is contained in:
Bram Moolenaar
2022-08-01 16:11:06 +01:00
parent 1f4ee19eef
commit 783ef7214b
4 changed files with 13 additions and 3 deletions

View File

@@ -226,7 +226,8 @@ prop_add_one(
if (text != NULL)
{
garray_T *gap = &buf->b_textprop_text;
garray_T *gap = &buf->b_textprop_text;
char_u *p;
// double check we got the right ID
if (-id - 1 != gap->ga_len)
@@ -236,6 +237,11 @@ prop_add_one(
if (ga_grow(gap, 1) == FAIL)
goto theend;
((char_u **)gap->ga_data)[gap->ga_len++] = text;
// change any Tab to a Space to make it simpler to compute the size
for (p = text; *p != NUL; MB_PTR_ADV(p))
if (*p == TAB)
*p = ' ';
text = NULL;
}