[vim/vim] virtual-text do not use background of 'wincolor' (Issue #11462)

33 views
Skip to first unread message

Roberto Castagnola

unread,
Oct 29, 2022, 9:15:28 AM10/29/22
to vim/vim, Subscribed

Steps to reproduce

vim --clean -c "call prop_type_add('Test', {'highlight': 'SpecialKey'}) | echo getwinvar([{'text': 'Some text', 'props': [{'col': 1, 'type': 'Test', 'text': ' + '}]}]->popup_create({'line': 5, 'col': 20, 'maxwidth': 80, 'highlight': 'PMenu', 'border': [], 'borderchars': [' '], 'moved': 'any'}), '&wincolor')"

image

Expected behaviour

Virtual text should use the value of wincolor (PMenu in the above example).

Version of Vim

9.0.818

Environment

Operating system: gentoo linux
Terminal: konsole
Value of $TERM: xterm-256color
Shell: zsh 5.9

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/11462@github.com>

bfrg

unread,
Oct 29, 2022, 2:44:26 PM10/29/22
to vim/vim, Subscribed

There is no virtual text in your example. What is the output of :hi SpecialKey?

And could you please use fenced code blocks? It's a lot easier to read than tucking everything into one line.


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/11462/1295933310@github.com>

Roberto Castagnola

unread,
Oct 29, 2022, 3:26:28 PM10/29/22
to vim/vim, Subscribed

Sorry, the virtual text is text: ' + ' defined in the text properties.
In a script it would look like:

vim9script
prop_type_add('Test', {'highlight': 'SpecialKey'})
var mytext = [{
  
'text': 'Some text',
  'props': [{
    'col': 1,
    'type': 'Test',
    'text': ' + '
  }]
}]
mytext->popup_create({
    
'line': 5,
    'col': 20,
    'maxwidth': 80,
    'highlight': 'PMenu',
    'border': [],
    'borderchars': [' '],
    'moved': 'any'
})

getwinvar was there only to prove that wincolor option was set as PMenu (but i missed to take it in the screenshot)
SpecialKey was just the first default highlight color without bg I took from :hi output for the test:

:hi SpecialKey                                                                                                                                                                                                             
SpecialKey     xxx term=bold ctermfg=81 guifg=Cyan


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/11462/1295945768@github.com>

Bram Moolenaar

unread,
Nov 17, 2022, 9:56:43 AM11/17/22
to vim/vim, Subscribed

Closed #11462 as completed via ee28c70.


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/11462/issue_event/7834755286@github.com>

Reply all
Reply to author
Forward
0 new messages