I had `tab_size` and `indent_size` set to 2 in my user.json, but lua_fmt which i just installed indents things with 4 spaces by default. So i checked if lua_fmt is configurable, it's not.
So i checked in the source code, and found this:
Code: Select all
def __str__(self):
r = ''
for node in self._nodes:
r += str(node)
enter_pos = r.find('\n')
r = r[:enter_pos].strip(' ') + r[enter_pos:]
if r.strip(' ') == '\n': return '\n' #20
return ' ' * _settings.get('tab_size') * self._indent + r
So it's
trying to pay attention to `tab_size`, but it's failing. if i change the call to `_settings.get('tab_size')` to another number myself, it uses that number. So it's somehow getting 4 from tab_size? I checked, and it doesn't look like i have any specific tab_size setting for the Lua lexer.