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

Indentation for multi-line elements #119

Open
FatBoyXPC opened this issue Sep 8, 2018 · 5 comments
Open

Indentation for multi-line elements #119

FatBoyXPC opened this issue Sep 8, 2018 · 5 comments

Comments

@FatBoyXPC
Copy link

I'm using sheerun/vim-polyglot, which makes use of this (and several other packages). It looks like indenting correctly on elements with attributes on their own line works differently than I expect.

In #31 you mention that it would likely be better for that user to suggest changes to othree/html5.vim. Do you suggest I do the same here?

Expected:

<template>
    <ul>
        <router-link
            v-for="(item, index) in menuList"
            :key="index"
            :to="item.path"
            tag="li"
        >
            <a>{{ item.title }}</a>
        </router-link>
</template>

Actual:

<template>
    <ul>
        <router-link
            v-for="(item, index) in menuList"
            :key="index"
            :to="item.path"
            tag="li"
            >
            <a>{{ item.title }}</a>
        </router-link>
</template>
@adriaanzon
Copy link
Collaborator

In #31 you mention that it would likely be better for that user to suggest changes to othree/html5.vim. Do you suggest I do the same here?

I think this is something that we could fix in this plugin, since it is common for tags in Vue templates to have a lot of attributes. Same applies to self-closing tags.

@FatBoyXPC
Copy link
Author

Awesome!

I'm not real clear on the resolution, though. Would you prefer to accept a PR, or do you mean that when time permits this will be fixed by the maintainers? I wouldn't mind taking a stab at it, but my vimscript-fu is pretty weak so it might be awhile if it's up to me 😆

@adriaanzon
Copy link
Collaborator

I'm planning to do this sometime.

@jcottrell
Copy link

This seems to be a problem with Vim itself. When I open a normal html file and format it the same way I format my vue file then I get the same behavior described above. I tracked it to $VIMRUNTIME/indent/html.vim but that's as far as I could get with my limited Vim knowledge.

@gil
Copy link

gil commented Jun 21, 2021

Hey folks! Any updates on this or some known workaround?

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

4 participants