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
627 stars 31 forks source link

fix: fix rendering issues that occur when 'shiftwidth' == 0 #53

Closed itepechi closed 1 year ago

itepechi commented 1 year ago

Some users (or plugins) set 'shiftwidth' to 0 to make (n)vim fall back to 'tabstop'. Since this plugin currently doesn't read 'tabstop', a 'shiftwidth' value of 0 will cause wrong placement of extmarks.

This PR replaces vim.o.shiftwidth with [vim.fn.shiftwidth()](https://neovim.io/doc/user/builtin.html#shiftwidth()) to handle such cases.


This PR doesn't include fixes for rendering errors caused by 'vartabstop' because virtually no one uses it. Even core plugins like nvim-treesitter don't care about it.

shellRaining commented 1 year ago

sorry for the delayed response. I will merge after some check later~

shellRaining commented 1 year ago

thanks for your contributions😄