-
Notifications
You must be signed in to change notification settings - Fork 293
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 doesn't work well with HEREDOC strings in erb #361
Comments
|
The indenting thing is a tricky issue. In general, there are two styles that eruby is mostly able to handle:
The mixture of the two doesn't work for a lot of other things:
In the heredoc case, unfortunately, the first format is syntactically invalid, because heredocs expect the end delimiter to be on its own line. Honestly, I wouldn't use a heredoc in ERB for that reason alone, it seems pretty fiddly regarding whitespace. You could use the
You could also use the second kind of indenting, like this:
I understand that, ideally, putting a closing delimiter at the right indent level should work regardless. It's a difficult problem to fix, though, and I really don't think anybody right now would have the time and energy to put into fixing it. I'll leave this issue open, because it's valid, but I'd recommend you try out a different indentation style. As for the highlighting, it seems to me like it's built-in and not really customizable. |
I'll just switch to
thanks :) |
When writing eruby file and using HEREDOC syntax, the indentation doesn't work that well. This is what vim produces when using default indentation:
The ending
%>
is off by one level to the left. I believe it should be like this:The text was updated successfully, but these errors were encountered: