Can virtual text overwrite existing text?

24 views
Skip to first unread message

Girish

unread,
Nov 22, 2023, 1:29:51 PM11/22/23
to vim_use
When I add 1 letter of virtual text through prop_add() it shifts the remaining text on the line by one character. Is it possible to make it overwrite existing text so there is no shifting of characters?
Thank you
girish

Tony Mechelynck

unread,
Nov 22, 2023, 2:00:13 PM11/22/23
to vim...@googlegroups.com
This is documented at ":help virtual-text". Depending on how you call
prop_add() your virtual text, which IIUC can be more than one
character long, pushes whatever is after it either horizontally or
vertically. If you want no shifting of characters it is possible to
display the virtual text "in column zero" and in that case "it will be
displayed above, below or after the actual text" depending on the
"text_align" and "text_wrap" arguments. Since the virtual text is not
editable it is not possible to place the cursor on it.

Best regards,
Tony.
Reply all
Reply to author
Forward
0 new messages