Incorret background size for virtual text #11320
-
SummaryIn some cases virtual text bg is smaller than virtual text. It's confusing because in themes which have virtual text bg you expect that, when moving cursor from left to right, cursor will jump to the next symbol after right side of virtual text, but in some cases cursor appears one symbol away. Reproduction Stepsaciinema recording: Source code:
I tried this:
I expected this to happen: Helix log~/.cache/helix/helix.log
PlatformLinux Terminal Emulatorptyxis Installation Methodf40 package Helix Versionhelix 24.3 (2cadec0) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
virtual text is not setup by us, we display whnatever the LSP sends. In this case I know for a fact that RA intentionally insert this space so that the next identifier isn't right next to the virtual text. To display this padding the padding parameter is used. The LSP standard explicitly says that this padding should have the same background color as the main text so we are just follwoing the LSP standard here. This behaviour also matches other editor like vscode (see screenshot, colors are a bit subtle but you can see that the space was inserted for the inlay hint that has the normal background color and not the background color of the virtual hint). It's an intentional choice of the language server that the text looks like this (if they wanted a separate background color they would have included a space in the text' instead of using pading) and we are respecting that in helix. |
Beta Was this translation helpful? Give feedback.
virtual text is not setup by us, we display whnatever the LSP sends. In this case I know for a fact that RA intentionally insert this space so that the next identifier isn't right next to the virtual text.
To display this padding the padding parameter is used. The LSP standard explicitly says that this padding should have the same background color as the main text so we are just follwoing the LSP standard here. This behaviour also matches other editor like vscode (see screenshot, colors are a bit subtle but you can see that the space was inserted for the inlay hint that has the normal background color and not the background color of the virtual hint).
It's an intentional choice of the la…