Script Editor auto-formatting does not respect aligned curly braces?

This afternoon I noticed something weird was happening whenever I try declaring a table with aligned curly braces. The script editor keeps forcing an additional tab on the next line, as if I was defining a table in an array.

While I recognize aligned curly braces go against Roblox’s Lua formatting standards, its just my own personal preference which I developed while working a lot with C# semantics. It hasn’t been an issue until recently, so I’m hoping this can be adjusted to support my existing code style going forward.

7 Likes

This is side effect of multi-line statement indentation, editor will indent 1 extra level for the second line of statement. We can make it configurable. However, we still suggest to turn on it and adjust code style, turn off it will cause other issue when you break statement into multi-line.

1 Like

I’m late to following up on this but yes I would like to have an option.
I’ve been trying to just ignore it but its starting to get on my nerves.

I made this visualization of my OCD with aligned curly braces awhile ago to try and explain it:

As a matter of personal preference I just don’t like that style and would prefer to continue using the one that I’ve been using. It worked fine before. I like to use the curly braces and extra line as a ruler for an imaginary box I wrap around the variables. My style derives more from C# and C++ than JavaScript.

And I mean, if I recall correctly from my time as an intern, aligned curly braces were the standard on Roblox’s C++ side of things. I recognize that my perspective on this is awkward and skewed, but ultimately I’d still like to advocate for at least having the choice.

3 Likes