-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove extra indentation of parentheses, similar to tables/function calls #274
Comments
Hm, I can't remember exactly why parentheses were indented a level further compared to others - I'll need to look into that. I do agree (if I can't find a concrete reason) that it's probably better to be consistent here. I'm a bit reluctant though because I imagine this is going to lead to a lot of diff changes |
Ah, I figured out why its indented one level further, but that doesn't mean we can't change it: Basically at an assignment, what we are doing here is hanging the assigned expression. In this case, the expression is a set of additions wrapped around in parentheses. local expr_result = 1
+ 2
+ 3
+ 4
+ 5 --a comment
+ 6
+ 6
+ 8
local instance = someReallyLongConditionExtremelyLongSoLongYourMindWillMelt
and someReallyLongCondition
and someOtherReallyLongCondition
or somethingElse If we remove this extra level of indentation, in the above two cases it will turn into local expr_result = 1
+ 2
+ 3
+ 4
+ 5 --a comment
+ 6
+ 6
+ 8
local instance = someReallyLongConditionExtremelyLongSoLongYourMindWillMelt
and someReallyLongCondition
and someOtherReallyLongCondition
or somethingElse which doesn't look that nice. We could special case parentheses to not hang here. The only issue I have with it is its a large diff change for a minor style change - need to weigh up the pros and cons |
Going to plan to fix this inconsistency having thought about it more - it definitely looks much better when everything is aligned the same way |
Stuff enclosed in parentheses seems to have an inconsistent indentation style.
Instead of looking like this:
It should look more like this:
The text was updated successfully, but these errors were encountered: