HampusHauffman / block.nvim

209 stars 2 forks source link

inlay hints truncating end strings #24

Open gennaro-tedesco opened 1 year ago

gennaro-tedesco commented 1 year ago

Recently inlay hints have been merged to neovim master branch and are available on nightly: obviously everybody is jumping on the train!

I have noticed that, by using block.nvim, some inlay hints are obfuscated, in particular by the end of the line, resulting in the end strings disappearing: see screenshot below

Screenshot 2023-06-21 at 13 39 33

(you can notice that often the last part of a string, say ".nvim", is truncated). This happens with all language servers.

What can be the root cause and do you believe this is solvable in the context of this plugin?

HampusHauffman commented 1 year ago

Yes its probably solvable. The issue is that when you add a inlay hints the line gets longer and the block plguin that adds extmarks at the end of each line overrides this. Not sure how to solve this in an ergonomic way atm though but it will have to be fixed eventually since as you said everyone is jumping on the train.

IndianBoy42 commented 1 year ago

I'm not sure how you calculate the size right now but you can use virtcol() to get the screen column of a file position. Another plugin I had to use lsp_lines also had to be patched to account for inline virtual text:

https://lists.sr.ht/~whynothugo/lsp_lines.nvim/patches/42031