shellRaining / hlchunk.nvim

This is the lua implementation of nvim-hlchunk, you can use this neovim plugin to highlight your indent line and the current chunk (context) your cursor stayed
MIT License
472 stars 29 forks source link

New changes re-introduce text-hiding bugs #106

Closed serhez closed 1 month ago

serhez commented 1 month ago

Describe the bug The new big changes that have come in the last several days have re-introduced bugs I had experienced in the past relating to the indent guides having higher priority than the real text in the buffer, therefore hiding the text. Personally, I have been unable to use the plugin because I often can't read the text in my files.

To Reproduce I am now encountering these bugs quite regularly, so I don't think there is the need to give a specific example. You should encounter the bug by just opening a large text file with different indentation levels and trying to press << (in normal mode) several times on a deeply indented line. If you do need a specific example, let me know.

Expected behavior I expect indent guides to never hide real text in any situation. It's quite possible I'm missing something, but couldn't the priority of the indent guides text simply be always lower than the real text? Perhaps it would be useful to see how indent-blankline does it, since this issue does not exist in that plugin?

Screenshots

A stupid badly-formatted example to showcase the issue (but I often encounter this issue in my real well-formatted code): Screenshot 2024-06-10 at 00 12 28

Extra information

Thanks for the amazing plugin :)

serhez commented 1 month ago

I've been trying different previous commits to see where these problems were re-introduced. In commit 919621eeb7225ee16b41fe19e140fa07f505e308, this issue does not seem to happen (but I haven't thoroughly tested).

EDIT: It seems commit 9efcf3b1dc3c1553e3dde881e6d1c6d01c2afa14 introduced the issue with the chunk guide only (not the indent guides). The indent guides hiding text was introduced either in commit fc66db0276b0274ca4214a2147bd0bf32ca64bf5 or in f44c5267b1916de5d25f004f38d0b9bd6a915687.

shellRaining commented 1 month ago

You may have enabled the use_treesitter option. I found it caused because following code was deleted (for bad perf)

https://github.com/shellRaining/hlchunk.nvim/blob/2f25e09d2d0a2c121225a46e8cfe3ff11225ac79/lua/hlchunk/mods/indent/init.lua#L48-L54

By the way, It is not recommended to use treesitter now, as for the more precise features mentioned earlier, I will try to make up for it.

shellRaining commented 1 month ago

latest version fix this~

serhez commented 1 month ago

I seems to work well now, thank you! :)