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

Wrong indent rule for tag <transition> #104

Open
byzf opened this issue Mar 30, 2018 · 4 comments
Open

Wrong indent rule for tag <transition> #104

byzf opened this issue Mar 30, 2018 · 4 comments

Comments

@byzf
Copy link

byzf commented Mar 30, 2018

Reproduction:
Start with a new buffer, set ft=vue, insert following:

<transition>
<router-view></router-view>
</transition>

Select and type ==

Expected behaviour:

<transition>
    <router-view></router-view>
</transition>

Actual behaviour:

<transition>
<router-view></router-view>
</transition>

Description:
"<transition>" is invalid in html5, Maybe need a option to add custom tagnames in vue, or use xml indent rule instead, as vue documentation allow that use PascalCase in single file components.

@adriaanzon
Copy link
Collaborator

XML indentation sounds like a good idea since that would also correctly indent self-closing tags.

@adriaanzon
Copy link
Collaborator

Unfortunately vim's XML indent script looks at the syntax group of the tags, so it doesn't work with HTML tags.

@nles
Copy link

nles commented May 28, 2018

You can use the html_indent_inctags variable to get the indentation of <transition> (or any other custom tag) to work correctly.

One way to do this is to add this to your .vimrc:
let g:html_indent_inctags = "transition"

@adriaanzon
Copy link
Collaborator

We could add transition and other vue-specific tags to b:html_indent_inctags, although this issue will then still exist for any custom component name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants