Skip to content

Hangable Prefix expression goes over width when it could be split #139

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

Closed
JohnnyMorganz opened this issue May 1, 2021 · 4 comments · Fixed by #142
Closed

Hangable Prefix expression goes over width when it could be split #139

JohnnyMorganz opened this issue May 1, 2021 · 4 comments · Fixed by #142
Labels
enhancement New feature or request

Comments

@JohnnyMorganz
Copy link
Owner

Function call which contains long concatenated string arguments are turned into single line. Can this be fixed?

For example

error("11111111111111111111111111111111111111111111111"
 .. "11111111111111111111111111111111111111111111111111111111")

I want this to be 2 lines to be fit in 120 columns, rather than a single line of

error("11111111111111111111111111111111111111111111111" .. "11111111111111111111111111111111111111111111111111111111")

Originally posted by @SafeteeWoW in #78 (comment)

@JohnnyMorganz
Copy link
Owner Author

@SafeteeWoW I just tested this, and it seems to be working as intended?
Over 120 characters, it gets formatted as:

error(
	"1111111111111111111111111111111111111111111111111111"
		.. "1111111111111111111111111111111111111111111111111111111111"
)

@SafeteeWoW
Copy link

@JohnnyMorganz
Copy link
Owner Author

Is there anything in particular to the file you wish to highlight - I couldn't see any code representing your original code sample.

I did see though, long lines of ("foooo" .. "barrrr" .. "bazzzzz"):format(), where the prefix expression at the front ("foooo" .. "barrrr" .. "bazzzzz"), is placed on a single line, but it could be hung. This could definitely be improved, but its not exactly the snippet you provided, as thats about function call arguments - is this the code you meant?

@SafeteeWoW
Copy link

The main problem is that many code is formatted beyond 120 column width,
mainly ("foooo" .. "barrrr" .. "bazzzzz"):format()

@JohnnyMorganz JohnnyMorganz changed the title Hangable Single function call goes over width when it could be split Hangable Prefix expression goes over width when it could be split May 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants