Skip to content
This repository

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

gareth-rees opened this Issue March 30, 2012 · 1 comment

2 participants

Gareth Rees David Miller
Gareth Rees

Open the following template in pony-tpl-mode:

{% block foo %}{% endblock %}

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

{% block foo %}{% endblock %}

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.

David Miller


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.


{% block foo %}{% endblock %}

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

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.