I totally didn't notice the existence of #7 and did my own implementation of better multiline ERB.
This PR does 2 things:
Subtract the indentation level from Syntax Tree line width
This could be even further improved: line length should take ERB tag start and end tag overhead in consideration
Change the way multiline ERB is formatted. It will do the following:
If formatted ruby yields more than 1 line, then:
The ERB tag start and end will be on separate lines
The entire Ruby code will be indented with an additional 2 spaces
If a mulit-line comment has its own (arbitrary) indentation, properly indent the entire comment underneath the ERB tags, preserving relative indentation
(Due to the fact that I was adding to repetitive logic, I chose to optimize the case statement. If this is undesirable and we prefer even more repetition, I'm OK with having that refactored back)
I totally didn't notice the existence of #7 and did my own implementation of better multiline ERB.
This PR does 2 things:
(Due to the fact that I was adding to repetitive logic, I chose to optimize the case statement. If this is undesirable and we prefer even more repetition, I'm OK with having that refactored back)