Open AndrewRadev opened 7 years ago
I'd love to see this merged. In the meantime, I've switched to using AndrewRadev/vim-mustache-handlebars
.
Bump. Is this repo being actively maintained?
@AndrewRadev Can you please resolve these conflicts?
I've rebased the branch on top of the current master (or rather, cherry-picked the changes without the variable renames), and I've fixed a bug I'd introduced. I'd recommend testing it out before merging, though, indentation is tricky.
I've merged the most recent master, and tested it out a bit, and it seems to work well now after #93. If you have time to test it out and find any issues to fix, let me know.
Thanks @AndrewRadev. Can you please add some test cases to example.mustache?
@jsit I've pushed an example of component with hanging attributes, and I've also applied a fix for that file -- it had an unclosed <a>
tag.
That said, I see there's a new example there of an angle-brackets component that doesn't seem to indent correctly:
<AngleBracketComponent
@mustache={{@bla}}
@number=123
data-test-id="test"
class="my-class" as |test|>
Some Text
<div>{{test.someValue}}</div>
<test.component teste="asdfads"></test.component>
</AngleBraketComponent>
But actually, even when I change to master, it still doesn't indent correctly, so that doesn't seem to be a regression from this PR. It might be something that's just not handled on my config and expects maybe HTML support to deal with it.
Well, either way, it seems like an unrelated issue.
@AndrewRadev Thanks; I've already got an issue for the angle bracket indent issue, #92
Will have a look at your hanging example now, thank you!
@AndrewRadev Also curious to get your opinion on #98
I think I've addressed your comments -- let me know what you think.
@AndrewRadev Also curious to get your opinion on #98
Yes, that seems like a very sensible change. I remember being confused by the explicit runtime
s of syntax and indent scripts, it would be much easier to understand to just have separate handlebars
and mustache
files where one includes the other.
An issue here: if I'm typing out a mustache element, rather than indenting one with =
, it stops correctly doing the hanging indent after the second line:
Although this seems to be an issue on master
, too, with standard blocks:
Edit: Filed #99 for this unrelated issue.
This PR implements a "hanging" attribute style. If the first line of the component has at least one attribute set on that line, the rest align according to that. So, it looks like this:
If the first line only has the component name, and not an attribute, it indents like it did before.
Unfortunately, I branched this PR off from my own master, which includes PRs #53 and #52. Depending on what you decide, I can rebase this on top of your master, but for now, I'll just leave it here for consideration as-is.