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

Inconsistent indentation for anonymous function assignments with comments. #627

Closed
bmcq-0 opened this issue Dec 3, 2022 · 1 comment
Closed
Labels
bug Something isn't working
Milestone

Comments

@bmcq-0
Copy link

bmcq-0 commented Dec 3, 2022

See the following code:

t = t or function()
	print("Hello, World") -- comment
end

t = t or function()
	print("Hello, World")
end

These are the exact same. However, the first has a comment in one of the statements. When formatting, this seems to somehow cause indentation inconsistencies:

t = t or function()
		print("Hello, World") -- comment
	end

t = t or function()
	print("Hello, World")
end

The comment can be anywhere, but the assinment seems to have to be in the form of a binary operation (?) (t = function()... does not yield the same inconsistencies, only t = t or ...)

@JohnnyMorganz JohnnyMorganz added the bug Something isn't working label Dec 3, 2022
@JohnnyMorganz
Copy link
Owner

I think this should get fixed when #591 is merged

@JohnnyMorganz JohnnyMorganz added this to the 0.16 milestone Dec 7, 2022
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

No branches or pull requests

2 participants