othree / html5.vim

HTML5 omnicomplete and syntax
http://www.vim.org/scripts/script.php?script_id=3236
934 stars 76 forks source link

unknown html tags not indented #51

Closed bartels closed 10 years ago

bartels commented 10 years ago

Using a custom html tag breaks indentation.

For example:

<html>
    <body>

        <section
            id="some-id"
            class="some-class"></section>

        <custom-tag
            id="another-id"
            class="another-class"></custom-tag>

    </body>
</html>

Now gg=G will unindent the id & class attributes on custom-tag. The indentation is also initially wrong if you "open" custom-tag to edit inside.

I can see custom tag names like this becoming widespread as web components get more usage.

othree commented 10 years ago

I agree. But not sure is this able to do by now.

asoltys commented 7 years ago

I was disappointed to find this issue closed with no solution but ended up finding this patched indent file that seems to do the trick: https://github.com/mgiuffrida/vim2/blob/patch-1/runtime/indent/html.vim

othree commented 7 years ago

There are more discussion spread in different issue. But people reported the one vim built-in have some issue. So I rollback the change.

And there is another PR now https://github.com/othree/html5.vim/pull/71/files But I don't have enough time to look and test.