[vim/vim] textprop: wrong Tab size in a line with virtual text above it (PR #20901)
h_east (Vim Github Repository) <[email protected]> Fri, 31 Jul 2026 13:39:36 -0700
| Newsgroups | gmane.editors.vim.devel |
|---|---|
| Message-ID | <vim/vim/pull/[email protected]> |
```
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".
You can view, comment on, or merge this pull request online at:
https://github.com/vim/vim/pull/20901
-- Commit Summary --
* textprop: wrong Tab size in a line with virtual text above it
-- File Changes --
M src/drawline.c (6)
M src/testdir/test_textprop.vim (33)
-- Patch Links --
https://github.com/vim/vim/pull/20901.patch
https://github.com/vim/vim/pull/20901.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/vim/vim/pull/20901
You are receiving this because you are subscribed to this thread.
Message ID: <vim/vim/pull/[email protected]>
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/vim_dev/vim/vim/pull/20901%40github.com.