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

Render unaligned when `shiftwidth` is not matched with current buffer #88

Closed konosubakonoakua closed 1 month ago

konosubakonoakua commented 5 months ago

Describe the bug If I have a file which use 4-space tab, but the vim set shiftwidth=2, the render is glitched.

Expected behavior Shell we provide an option to let use choice which size of tab should be respected, the vim setting or file content.

shellRaining commented 2 months ago

It seems that what you want is the "guess indent" effect. I will try to implement it.

https://github.com/NMAC427/guess-indent.nvim

shellRaining commented 1 month ago

I found that guess-indent and hlchunk work well together, and guess-indent itself performs very well, so there is no need to add this part for now. If you are still interested in this issue, feel free to submit a pull request.

You can add an automatic command bufReadPost in base_mod, and set a callback function guess indent in this automatic command.