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

Line wraps when formatting a second time #296

Closed
TjeuKayim opened this issue Nov 11, 2021 · 1 comment · Fixed by #300
Closed

Line wraps when formatting a second time #296

TjeuKayim opened this issue Nov 11, 2021 · 1 comment · Fixed by #300
Labels
bug Something isn't working

Comments

@TjeuKayim
Copy link

TjeuKayim commented Nov 11, 2021

Steps to reproduce:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa({ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = false})
-- becomes this after running stylua with the default settings
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa({ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = false })
-- running stylua again makes it wrap, because it exceeds the column limit
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa({
	aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = false,
})
-- running it again does not change the formatting

What I expected: StyLua should get to the third line in one run.

Version: 0.11.1

@JohnnyMorganz JohnnyMorganz added the bug Something isn't working label Nov 11, 2021
@JohnnyMorganz
Copy link
Owner

I think there is also another subtle bug here, in that the second version (with spaces before/after each brace) is just at the column width (120), so it should just stay at the second point, on one line.

If I fix the above bug, then this overall bug should no longer happen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants