Skip to content
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

Automatic splitting / joining lines respecting max length #78

Closed
ddickstein opened this issue Dec 24, 2022 · 2 comments
Closed

Automatic splitting / joining lines respecting max length #78

ddickstein opened this issue Dec 24, 2022 · 2 comments
Milestone

Comments

@ddickstein
Copy link

It would be great if there were an option to automatically split and join lines to respect a max length where the line is split when the max length is exceeded and joined when it can all be fit on a single line without exceeding max length. How to split expressions is of course quite opinionated, so this would probably need to be controlled by multiple options. For example, one might want to support:

local x = {
  foo,
  bar,
  baz,
}

and

local x =
  { foo, bar, baz }

but never

local x =
  { foo, bar,
     baz }

I'm not sure how many options are needed here to satisfy all the different kinds of layouts people might want to allow and disallow (e.g., whether baz in the first example there should always / never end in a comma, whether to use trailing or leading commas, etc.) and I haven't thought too much about other kinds of expressions.

@CppCXY
Copy link
Owner

CppCXY commented Dec 25, 2022

this is a feature that needs to be studied, and need to wait for me to finish refactor

@ddickstein
Copy link
Author

That makes sense - supporting this properly I'm sure would add considerable complexity.

@CppCXY CppCXY added this to the 1.0.0 milestone Dec 26, 2022
@CppCXY CppCXY mentioned this issue Jan 4, 2023
16 tasks
CppCXY added a commit that referenced this issue Jan 16, 2023
@CppCXY CppCXY closed this as completed Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants