mattn / emmet-vim

emmet for vim: http://emmet.io/
http://mattn.github.io/emmet-vim
MIT License
6.39k stars 411 forks source link

Custom snippet for erb doesn't indent end tag properly #543

Open coaxial opened 1 year ago

coaxial commented 1 year ago

I'm creating a custom snippet for erb tags:

<%= ... %>
  ...
<% end %

~/.snippets_custom.json:

{
  "eruby": {
    "extends": "html",
    "snippets": {
      "erb": "<%= | %>\n\t${child}<% end %>"
    }
  }
}

And when doing div>erb>p, the output is:

<div>
  <%=  %>
    <p></p>
    <% end %>
</div>

Note how the <% end %> is indented one level too much, and doesn't match the json file.

If I add \n after ${child}, so ...${child}\n<% end %>, then the indent is correct but there is obviously an extra, unneeded line before the end tag.