Open jasonlav opened 10 years ago
Just tried to reproduce but this doesn't happen to me. Might be a combination with some other package? Could you please try temporarily disabling other packages and see if it still happens?
Reproduced it with a clean installation of Sublime Text 3. I tried text and tab indentation and both had the same issue.
It appears to ONLY be an issue if there is a single tag in the body. For example, if I have a 2nd P tag below the "Example copy" it doesn't do it.
I finally managed to reproduce it, although it doesn't always happen.
Still not really sure what's going on, but I do have a clue. When looking at the scope, this is what ST says: Scope: text.html.handlebars source.smarty.embedded.html
.
There's not a single mention of Smarty in this Handlebars package, so this seems to be something inherited from the built in HTML definitions. The HTML5 package has it too: https://github.com/mrmartineau/HTML5/blob/master/Syntaxes/HTML%205.YAML-tmLanguage#L224
The only solution I can think of right now is to redefine a big chunk of the HTML package to override this behaviour, but that's a bit of a pain to maintain :(
No worries. Thanks for taking a look. It is a very narrow niche case bug; I doubt many will run into it.
I don't think this issue is limited to when body
contains only a single tag. I actually run into this quite frequently, even in larger Handlebars files. The problem also sometimes occurs for me when typing above a Handlebars expression. For example:
{{
{{someValue}}
}
I run into this issue a lot. For example, if I want to wrap the p
tag below inside a new {{#if}}
block:
<div>
<p></p>
</div>
When I start to type the {{#if
on a new line inside the div
but above the p
, I get:
<div>
{
<p></p>
}
</div>
Just like the original poster’s screen recording. I have lots of other HTML on this page, so it’s not confined to a single tag in a body
.
:+1:
When adding handlebars indented with HTML below, the close curly braces are not added to the appropriate place.