vim --clean
40vsplit call setline(1, repeat('a', 40)) call prop_type_add('test', {}) call prop_add(1, 0, {'type': 'test', 'text': 'bbb', 'text_wrap': 'truncate'})
virtual text should not render
9.0.1562
MacOS 13.4
terminal: wezterm 20230408-112425-69ae8472
shell: fish 3.6.1
No response
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
It looks like this is caused by this code
https://github.com/vim/vim/blob/315cd1fbcbba7c44ec8743f03645bfcaef58bd55/src/drawline.c#L628-L630
where PROP_TEXT_MIN_CELLS
is 4
and your virtual text has only a length of 3. If the virtual text is longer, then you will see it truncated when there is space for 4 or more characters. Also, if wrapping is turned off in general with set nowrap
, then you should also see the virtual text get truncated properly, even if there is room for less than 4 characters.
That makes it seem like the behaviour may be intentional, although using git log -p -G 'space < PROP_TEXT_MIN_CELLS' src/drawline.c
I found that commit 04e0ed1 seems to have changed this behaviour from being exclusively for text_align: 'right'
virtual text. The behaviour for text_align: 'right'
virtual text is also different, since if less than 4 characters of that text fits, then it wraps from the start of that virtual text to the next line. In contrast to text_align: 'after'
from your example splits up the text by trying to put the first 1-3 characters of the virtual text on the first line if there is room.
Given that context, I wonder it was intentional that this PROP_TEXT_MIN_CELLS
behaviour affects virtual text other than text_align: 'right'
or whether that was an unintentional bug.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
I looked for where the behaviour was introduced and although it moved around a bit, it looks like it has been that way since virtual text truncation was first implemented in commit 398649e
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.