Problem: In a line with virtual text above it a Tab does not have the right
size, depending on the width of the window.
Solution: Do not count the virtual text for the size of the Tab.
fixes: #12232
set tabstop=8
call prop_type_add('above', #{highlight: 'Search'})
call prop_add(2, 0, #{type: 'above', text: 'text above',
\ text_align: 'above'})
With a Tab at the start of line 2 it is drawn with the wrong width, and how
wrong depends on 'columns': the column used for the size of the Tab counts
the screen line of the virtual text as well. It happened to be right when
the window width was a multiple of 'tabstop'.
The other half of the issue, a Tab in the virtual text itself, is documented
behaviour: "Any Tab and other control character in the text will be changed
to a space".
https://github.com/vim/vim/pull/20901
(2 files)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
This solution isn't sufficient and leads to another problem. If you have a Tab that's not the first char of the line (e.g. two leading Tabs):
123456789 123456789 123456789 123456789 123456789 12345678 | space prefixed text | tab prefixed text | space prefixed text | double tab prefixed text set tabstop=8 call prop_type_add("test", { 'highlight' : 'Error' }) call prop_clear(1, 99) call prop_add(3, 0, { 'text_align' : 'above', 'text' : '|<-', 'type': 'test', 'text_padding_left' : 8 }) call prop_add(4, 0, { 'text_align' : 'above', 'text' : '|<-', 'type': 'test', 'text_padding_left' : 8 }) call prop_add(5, 0, { 'text_align' : 'above', 'text' : ' |<-', 'type': 'test'}) call prop_add(6, 0, { 'text_align' : 'above', 'text' : "\t|<-", 'type': 'test'})
With a window width of 75, if you type 6gg0fd, you'll find that the cursor isn't placed on the d. Before this PR, the cursor is placed on the d, but the Tab size is incorrect.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()