Closed XeroOl closed 2 years ago
Thanks a lot for submitting such a detailed bug report! You're completely right about 0
being a special value
I'll fix this bug today :)
For me it still isn't working correctly. I've got a file with just this in it:
{
» "Lua.diagnostics.globals": [
» » "vim"
» ]
}
where »
is the tab character, and the plugin doesn't seem to set noexpandtab for me for tabstop=4 shiftwidth=0 expandtab
, but it does get set with tabstop=4 shiftwidth=4 expandtab
Oh you're right, I went a bit too fast when testing the fix sorry :/
Since I forgot 0 isn't a falsy value in Lua, the problem is probably just this line:
I'll fix it when I get back to my computer. Thanks for telling me!
When the vim option
shiftwidth
is set to0
, the plugin fails to detect properly. You can reproduce with what's in my config.According to
:help shiftwidth
, if shiftwidth is set to zero, it should act the same as if it were set to the value oftabstop
instead. I think this plugin uses0
as a special value, and gets confused when detecting.The workaround is to manually set shiftwidth to match tabstop, but this should be pretty simple to fix in the plugin.