Yegappan wrote:

> Currently the prop_add_list() function doesn't support adding multiple
> virtual text properties.  This functionality is useful when applying
> the inlay hints reply received from a LSP server.

What is against calling prop_add() for each one?

prop_add_list() is intended to add the same type of property and a list
of positions.  I don't expect you want to add the same text in a list of
positions?  Unless it's some kind of error or marker.

> Should we extend the prop_add_list() function to support the "text"
> value in the second argument?  The second argument (list of items)
> needs to support the following:
> 
>      [{lnum}, {col}, {end-lnum}, {end-col}, "text"]
> 
> Should we make the "text_align", "text_padding_left" and "text_wrap"
> properties common to all the text properties or support a dict for the
> list element:
> 
>      [{lnum}, {col}, {end-lnum}, {end-col}, {'text': value, 'text_align': 
> value,
>                                                 'text_padding_left':
> value, 'text'wrap': value}]

This quickly gets complicated, since depending on what you are adding
some fields will be the same for all properties and some will be
different.  I doubt the complexity is justified by calling one function
for multiple text properties instead of calling prop_add() for each one.

Is there a virtual text property with several fields that are the same
(padding, align, etc.) and only differ in position and text?

-- 
Although the scythe isn't pre-eminent among the weapons of war, anyone who
has been on the wrong end of, say, a peasants' revolt will know that in
skilled hands it is fearsome.
                                        -- (Terry Pratchett, Mort)

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
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 on the web visit 
https://groups.google.com/d/msgid/vim_dev/20221126212549.222771C0842%40moolenaar.net.

Raspunde prin e-mail lui