You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bracket matching doesn't also work; when on the > in %>, tha highlighted bracket is on second < in <<~EOF while it should be on < in <%=. Is this plugin also responsible for it?
The indenting thing is a tricky issue. In general, there are two styles that eruby is mostly able to handle:
<div>
<%= foo = {
bar: 'baz'
} %>
</div>
<div>
<%=
foo = {
bar: 'baz'
}
%>
</div>
The mixture of the two doesn't work for a lot of other things:
<div>
<%= foo = {
bar: 'baz'
}
%>
</div>
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 %{ } delimiter, and that seems to work well with the closing ERB delimiter:
<div>
<%= foo = %{
String content
} %>
</div>
You could also use the second kind of indenting, like this:
<div>
<%=
foo <<~EOF
Bla
EOF
%>
</div>
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.
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: