Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

HTML Templating un-indents template helpers #10564

Open
jeffshaver opened this issue Feb 10, 2015 · 1 comment
Open

HTML Templating un-indents template helpers #10564

jeffshaver opened this issue Feb 10, 2015 · 1 comment

Comments

@jeffshaver
Copy link

If you type something like:

<div class="blah">
  {{#each posts}}

  {{/each}}
</div>

If you type more brackets inside the each template helper, it gets un-indented and you end up with

<div class="blah">
  {{#each posts}}
  {{post.title}}
  {{/each}}
</div>

instead of

<div class="blah">
  {{#each posts}}
    {{post.title}}
  {{/each}}
</div>
@peterflynn
Copy link
Member

The main issue is that the plain HTML syntax mode doesn't know that {{#each}} blocks should add an extra level of indent, so anything that triggers re-indentation will jump the cursor back one tab stop. As a secondary bug, Brackets treats } as a character to trigger re-indentation even in languages where it shouldn't, like HTML.

The secondary bug should be fixed by PR #9387. But after that, you'll still see unwanted un-indenting when typing closing HTML tags. To fix that, we'd need full syntax mode support for templating languages so that Brackets understands what the correct indent level should be.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants