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

Indentation edge case #194

Open
aaronjensen opened this issue Dec 22, 2022 · 4 comments
Open

Indentation edge case #194

aaronjensen opened this issue Dec 22, 2022 · 4 comments
Assignees

Comments

@aaronjensen
Copy link

The i in this monstrosity is improperly indented with enh-ruby-mode at the moment:

x =
  bar(
    y
  ).map do |i|
  i
  end
@zenspider
Copy link
Owner

zenspider commented Jan 4, 2023

interestingly, it doesn't if you drop the map to the next line:

x =
  bar(
    y
  )
  .map do |i|
    i
  end

ETA: braces vs do/end do not make a difference

@zenspider zenspider self-assigned this Jan 4, 2023
@zenspider
Copy link
Owner

You should come up to vivace and help me debug this thing...

current debugging note: Hits https://github.com/zenspider/enhanced-ruby-mode/blob/master/enh-ruby-mode.el#L992-L996 which backs up to the PREVIOUS line, calculates that indent, and then uses that. Apparently doesn't see the block's do. Still digging. I hate this code.

@aaronjensen
Copy link
Author

I totally would, but i'm in FL for the time being. And yeah, I hear you about the code, it's rough to sort through.

@zenspider
Copy link
Owner

offer still stands

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

2 participants