[vim/vim] Virtual Text property at same location as other text property not drawn (Issue #10879)

7 views
Skip to first unread message

Ben Jackson

unread,
Aug 9, 2022, 5:27:17 PM8/9/22
to vim/vim, Subscribed

Steps to reproduce

call prop_type_add( 'Virtual', #{ highlight: 'Error' } )
call prop_type_add( 'Function', #{ highlight: 'Function' } )
call prop_type_add( 'Identifier', #{ highlight: 'Identifier' } )

  " function( call, argument, here )

call prop_add( 5, 5, #{ type: 'Function', length: len( 'function' ) } )
call prop_add( 5, 15, #{ type: 'Identifier', length: len( 'call' ) } )
call prop_add( 5, 21, #{ type: 'Identifier', length: len( 'argument' ) } )
call prop_add( 5, 31, #{ type: 'Identifier', length: len( 'here' ) } )


call prop_add( 5, 15, #{ type: 'Virtual', text: 'name1:' } )
call prop_add( 5, 21, #{ type: 'Virtual', text: 'name2:' } )
call prop_add( 5, 31, #{ type: 'Virtual', text: 'name3:' } )

vim --clean -S test.vim test.vim

Screenshot 2022-08-09 at 22 24 23

See how the 'name1:', etc. are not rendered. They also cause the cursor to be in the wrong position in the line (move cursor along line 5 to replicate).

Expected behaviour

Reversing the calls, so that the 'virtual text' property is added first resolves it and works well:

call prop_type_add( 'Virtual', #{ highlight: 'Error' } )
call prop_type_add( 'Function', #{ highlight: 'Function' } )
call prop_type_add( 'Identifier', #{ highlight: 'Identifier' } )

  " function( call, argument, here )


call prop_add( 5, 15, #{ type: 'Virtual', text: 'name1:' } )
call prop_add( 5, 21, #{ type: 'Virtual', text: 'name2:' } )
call prop_add( 5, 31, #{ type: 'Virtual', text: 'name3:' } )

call prop_add( 5, 5, #{ type: 'Function', length: len( 'function' ) } )
call prop_add( 5, 15, #{ type: 'Identifier', length: len( 'call' ) } )
call prop_add( 5, 21, #{ type: 'Identifier', length: len( 'argument' ) } )
call prop_add( 5, 31, #{ type: 'Identifier', length: len( 'here' ) } )

Screenshot 2022-08-09 at 22 24 34

I'd expect these two to be equivalent.

Version of Vim

9.0.181

Environment

macOS arm64

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

Bram Moolenaar

unread,
Aug 10, 2022, 11:01:20 AM8/10/22
to vim/vim, Subscribed

Closed #10879 as completed via 952c9b0.


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/10879/issue_event/7164661363@github.com>

Reply all
Reply to author
Forward
0 new messages