Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template indentation is wrong when there are multiple tags on a line #51

Open
gareth-rees opened this issue Mar 30, 2012 · 1 comment
Open
Assignees
Milestone

Comments

@gareth-rees
Copy link
Contributor

Open the following template in pony-tpl-mode:

<img>
{% block foo %}{% endblock %}
<img>

and indent the whole file (C-x h C-M-\). The result is as follows:

<img>
{% block foo %}{% endblock %}
  <img>

with the second <img> incorrectly indented. This is because pony-calculate-indent-backward recognizes that the {% block foo %} starts an indented block but does not recognize that the {% endblock %} closes that block.

The indentation calculation needs to look at all tags on a line, not just the first tag.

@davidmiller
Copy link
Owner

Thoughts:

I can't recreate this issue when I paste your example into a new template.

I end up with all three lines without an indent - running from the latest Pony Mode master, Emacs 23.

e.g.

<img>
{% block foo %}{% endblock %}
<img>

Which is the "Right Thing" AFAIC

I added a test for this - if you run

$ rake test

... from the root of the repo on a local checkout you should see four passing tests

@ghost ghost assigned davidmiller Apr 8, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants