Yegappan wrote:

> When a virtual text is truncated, cursor positioning is incorrect. I
> am seeing this issue when using inlay hints with the Vim9 LSP plugin.
> 
> To see this issue, source the following test script:
> 
> -----------------------------------------------------------------------------------------
> new
> call prop_type_add('Param', #{highlight: 'Conceal'})
> call setline(1, "\t\t\t\tif (var_check_fixed(test_flag, arg_errmsg, 
> gettext))")
> call prop_add(1, 25, #{type: 'Param', text: 'flags: '})
> call prop_add(1, 36, #{type: 'Param', text: 'long_name_arg: '})
> -----------------------------------------------------------------------------------------
> 
> After sourcing the above script, press '$' on line 1. You will see that the
> cursor is positioned some columns after the last character. Also, if you
> press '%' from one of the opening parenthesis on this line, you will
> see that the cursor is not correctly positioned at the closing parenthesis.

Two places in the code don't agree what happens with virtual text that
is placed somewhere inside the line.  When drawing the text it is
truncated at the window edge, when computing the cursor position it is
not truncated.

I actually do not see a good reason why this text would be truncated at
the window edge.  It is inserted at a certain position in the text,
there is no relation whether this is close to the window edge or not.

Let me not truncated the text, see if any tests fail.  If that seems to
work we'll have to see if some users depended on the truncation.

-- 
FROG: How you English say:  I one more time, mac, I unclog my nose towards
      you, sons of a window-dresser,  so, you think you could out-clever us
      French fellows with your silly knees-bent creeping about advancing
      behaviour.  (blows a raspberry) I wave my private parts at your aunties,
      you brightly-coloured, mealy-templed, cranberry-smelling, electric
      donkey-bottom biters.
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// 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/20230101135133.D03D31C0AA4%40moolenaar.net.

Raspunde prin e-mail lui