Skip to content

Add initial support for `haml-js` #38

Closed
wants to merge 1 commit into from

2 participants

@bernerdschaefer

This adds support for haml-js, while trying to change as little as
possible with the existing implementation.

It's a bit rough around the edges -- I didn't (at present) want to rename all of the ruby* syntax names, but will if this is something worth pulling in. Thoughts?

@bernerdschaefer bernerdschaefer Add initial support for `haml-js`
This adds support for `haml-js`[1], while trying to change as little as
possible with the existing implementation.

[1] https://github.com/creationix/haml-js
3603482
@tpope
Owner
tpope commented Jun 17, 2012

How much trouble would it be to split into two file types? Making behaviors contingent on the filename is asking for trouble. (I have learned this lesson from experience.)

@bernerdschaefer

I'm not sure. I had started with a separate vim-hamljs, looking to inherit behavior from vim-haml, but my knowledge of how the syntax files work was too narrow to figure out how to inherit only what I wanted / over-ride certain things. I agree that the filename dependent behavior is less than ideal.

Looking at it, though, I should be able to selectively remove the ruby declarations and add back in the javascript ones. Do you see a nice way to handle the indentation changes?

@tpope
Owner
tpope commented Jun 30, 2012

It looks like the only indenting difference is two sets of keywords (if style and else style, for lack of a better name), right? If so, I think two buffer local variables containing which keywords to use would be reasonable enough. Override them in indent/hamljs.vim after runtime! indent/haml.vim.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.