-
Notifications
You must be signed in to change notification settings - Fork 29
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
Support aligning leading commas with leading { and ( #77
Comments
this is a very unusual style, is there any particular reason |
I grant that it's uncommon. I think it's a style that tends to be more favored in languages that do not allow trailing commas because it removes the friction of editing the end of the list of fields (at the cost of adding friction when editing the start of the list). I think the argument for supporting it in Lua is mostly for trying to keep similar styles across a multi-lingual codebase where the comma-leading style has been adopted in other places. For example, in a Neovim codebase you might have Vimscript and Lua mixed, and the reason you might adopt a leading comma style in Vimscript is that the
The other arguable benefit of a leading-comma style is that it keeps the logic on the left and the data on the right - similar to the reason you might want to break up a long
|
I accept this reason, but it will take time to study |
leading comma for '{' : local t =
{ a = 123
, kjfolw = 123
, sjofjmwo = 123
} for '(': callll
( aaa
, bbb
, ccc
) but what does '[' look like? |
Good point - it doesn't apply in lua. I'll remove it from the title and original post. |
Can an option to be added to support aligning commas with { and ( to enable this style:
The text was updated successfully, but these errors were encountered: