fxbois / web-mode

web template editing mode for emacs
https://web-mode.org
GNU General Public License v3.0
1.63k stars 262 forks source link

indentation of nunjucks `{% set varname %}` **blocks** (i.e., not `{% set varname = value %}`) #1226

Closed dse closed 2 years ago

dse commented 2 years ago

In nunjucks templates where web-mode-engine is django, {% set %} blocks are not indented correctly.
Note that I am specifically referring to when {% set %} is supplied only with a variable name, not with the equal sign nor a value.
{% set var = val %} does not start a block and indentation of subsequent code is correct in that case.

Before (all lines have indentation):

    {% set foo %}
    bar
    {% endset %}

Expected results after indentation:

{% set foo %}
    bar
{% endset %}

Actual results:

{% set foo %}
bar
    {% endset %}

Perhaps another minor template engine (like jinja) needs to be created?

fxbois commented 2 years ago

done with last commit