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

Incorrect line num highlight and mismatch with chunk scope #101

Closed theSprog closed 2 months ago

theSprog commented 3 months ago

When I used this plugin, I found that sometimes the line num on the left and the chunk scope didn't match up well. It's hard to describe this problem in words, so I provided a gif to show it.

bug

When the range of line num is 112-115, I press w to jump to the next word. However, after the chunk has disappeared, the line num on the left is still highlighted, but when I press jk, the line num on the left is still highlighted. Normal display restored. When I press h again to move the cursor outside {}, the chunk range displays normally, but the line num still does not return to the same range as the chunk. I think this is confusing

What I expected was that the line num on the left would always be consistent with the chunk

shellRaining commented 2 months ago

Because the line_num mod does not use treesitter by default to find the scope of the current block, please refer to the documentation for details.