tpope / vim-endwise

endwise.vim: Wisely add

Home Page:https://www.vim.org/scripts/script.php?script_id=2386

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

In the FileType htmldjango section, the block definition adds unnecessary block name

lonetwin opened this issue · comments

The FileType htmldjango autocmd section has the entry:

let b:endwise_words = 'autoescape,block\(\s\+\S*\)\?,blocktrans...

which has the effect of adding the block name to the endblock tag, ie:

{% block foo %}
    |
{% endblock foo %}

I don't know whether this used to be required for an early version of django or whether this is for the sake of compatibility with other similar templating schemes but AFAICT this is incorrect django template syntax. The django implementation requires the block tag to end with a simple endblock tag like so:

{% block foo %}
    |
{% endblock %}

I've verified that removing the regex from the line mentioned above corrects the reported behavior.

Please send a pull request. Endwise has been a real lesson in "don't take ownership for file types you don't use."

Endwise has been a real lesson in "don't take ownership for file types you don't use."

😄 ...but you've done so much ! Seems like I forgot to say this -- Thanks for all of your work in enhancing the usability of vim !

Thanks! I'm just saying it would be better for all involved if this lived in a vim-endwise-django plugin or a generic Django plugin maintained by an actual Django user.