leafOfTree / vim-vue-plugin

Vim syntax and indent plugin for .vue files
The Unlicense
177 stars 9 forks source link

There are unexpected indentation problems. #9

Closed roket1428 closed 5 years ago

roket1428 commented 5 years ago

As you can see on this image, there are unexpected indentation problems. I use gg=G to auto-indent file.

leafOfTree commented 5 years ago

Thank you for this bug report. XML indentation method is used for common tag indentation, which doesn't handle empty tags like <input > correctly( but <input /> I am used to writing ).

So <input />, <img /> ... self closed tags can get correct indentation for the time being. And I'll see if XML can handle empty tags later.

leafOfTree commented 5 years ago

My solution is only using HTML indentation for empty tags. Now it's ok to use both <input> and <input />.

roket1428 commented 5 years ago

I'll not close this issue until I have enough experience with your plugin. But for now, it is working like a charm, good job man.

roket1428 commented 5 years ago

There are still indentation problems. :)

leafOfTree commented 5 years ago

Yes, there are some indentation problems with /> followed by a blank line. Now it should work.

I haven't used IRC before. But I heard about freenode and have used Gitter. Maybe we can discuss issues in this Gitter room if you encounter them later.

https://gitter.im/vim-vue-plugin/community?utm_source=share-link&utm_medium=link&utm_campaign=share-link

roket1428 commented 5 years ago

Haha, I found another indentation error. :P If you add html comments that include tags in somewhere, indentation gets broken.

leafOfTree commented 5 years ago

Yes, indentation error occurs with <input> inside comments. It seems that mixed use of XML and HTML indentation causes some trouble. So now I only use XML indentation and patch it to indent as expected.

roket1428 commented 5 years ago

Could you check your gitter out? I wanna show something.

leafOfTree commented 5 years ago

Sure.