[vim/vim] virtual text not displayed with 'nowrap' and when 'text_align' is set to 'below (Issue #10851)

106 views
Skip to first unread message

bfrg

unread,
Aug 5, 2022, 3:50:25 PM8/5/22
to vim/vim, Subscribed

Steps to reproduce

Run vim --clean -S test.vim, with

vim9script
edit foobar
&wrap = false
&showbreak = '+++ '
setline(1, '12345678')
prop_type_add('test', {highlight: 'Special'})
prop_add(1, 0, {
    type: 'test',
    text: 'the quick brown fox jumps over the lazy dog',
    text_align: 'below'
})

Result: virtual text is not displayed.

Note: When wrap is enabled, the virtual text is displayed but then the showbreak characters are also displayed before the virtual text.

Expected behaviour

Virtual text should always be displayed.

Version of Vim

9.0.147

Environment

Linux

Logs and stack traces

No response


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/10851@github.com>

Bram Moolenaar

unread,
Aug 5, 2022, 4:57:24 PM8/5/22
to vim/vim, Subscribed

These are two separate issues - showing 'showbreak' and using 'nowrap'.

I fixed 'showbreak' for a text property below, I'm not sure what should happen for a wrapping text property. Currently it does show the 'showbreak' text, and I would think that is OK.

When 'wrap' is off then with a "below" virtual text we break with the certainty that a buffer line always occupies one screen line, that is likely to require changes in various places.
Also, when 'wrap' is off truncating the virtual text should probably not happen.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/10851/1206857795@github.com>

Bram Moolenaar

unread,
Aug 6, 2022, 8:49:09 AM8/6/22
to vim/vim, Subscribed

Closed #10851 as completed via 4d91d34.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issue/10851/issue_event/7140927681@github.com>

bfrg

unread,
Aug 6, 2022, 9:29:59 AM8/6/22
to vim/vim, Subscribed

Thank you for the quick fix.

Unfortunately, now the virtual text is displayed in the sign column when it's enabled. This only happens with set signcolumn=yes and set nowrap.

Example:

vim9script
edit foobar
&wrap =
 false
&signcolumn = 'yes'
setline(1, '12345678')
prop_type_add('test', {highlight: 'Special'})
prop_add(1, 0, {
    type: 'test',
    text: 'the quick brown fox jumps over the lazy dog',
    text_align: 'below'
})


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/10851/1207215324@github.com>

Reply all
Reply to author
Forward
0 new messages