briancollins / vim-jst

A vim plugin for highlighting and indenting JST/EJS syntax
MIT License
94 stars 16 forks source link

Indentation issues #2

Open eric-hu opened 12 years ago

eric-hu commented 12 years ago

Thanks for writing this plugin! It's been a huge help for me in working with Backbone.js

I've been having some indentation issues with .jst.ejs.haml files--I'm not sure if this is stepping outside the scope of your intended use for vim-jst. I can provide an example, though

.submit_wr
  %input{:type => "submit", :value => "Create Membership"}

Hitting enter after the cursor is at the right curly brace, this becomes

.submit_wr
%input{:type => "submit", :value => "Create Membership"}
%

Similarly, adding a left curly brace will unindent text as well:

.submit_wr
%input{:type => "submit", :value => "Create Membership"}{
briancollins commented 12 years ago

Are you generating Haml with a jst template?

eric-hu commented 12 years ago

With the jst.ejs.haml format, I'm generating a jst template file from haml on the server, then sending it down to the client. The client interprets the jst template file and builds out HTML elements from it. It's a bit convoluted, but has been the fastest way I've found to build out views using Backbone.js