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

rescue; else blocks nested in outer else blocks misplaces comments #460

Open
reese opened this issue Jan 26, 2024 · 0 comments
Open

rescue; else blocks nested in outer else blocks misplaces comments #460

reese opened this issue Jan 26, 2024 · 0 comments

Comments

@reese
Copy link
Collaborator

reese commented Jan 26, 2024

  • Ruby version: 0.10.0
  • Rubyfmt git sha: 78c57d7

Input file

if stuff
else
  # This message should stay here!
  begin
  else
  end
end

Rubyfmt's output

if stuff

  # This message should stay here!

else
  begin
  else
  end
end

This breaks because

I'd expect the comment to remain unchanged, but I think the line winding for else blocks in begin/rescue may be busted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant