> I have another issue want to discuss. > Also html indent function. > > 2 issues about indent attribute only lines. > > Now it is depend on the previous line have property. > > <main class=""> > <div id="abc" > class="foo" > > But some people don't write like this, but write all attributes in new line > > <main class=""> > <div > id="abc" > class="foo" > > This code snippet will not indent correctly. And this style is official > coding style for the Vue web framework[1] > > My approach is to check if previous line is the start line of the tag. > If yes, add one level of indent. If no, go next line. > I have a quick fix version of this approach[2]. > Do you think this fix is ok? > > And the second issue is some attribute don't need to have a value. > For example: > > <script async > src="foo" > > This can be solve by similar fix. > > > [1]:https://vuejs.org/v2/guide/components.html#Replacing-Merging-with-Existing-Attributes > [2]:https://github.com/othree/html5.vim/blob/master/indent/html.vim#L924-L929
Thanks. At first I thought it didn't work at all, until I realized I had Tabs in the file, and there is a TODO or that. Let's fix that as well. A few simple tests show it works fine. -- Git catch 22: "merge is not possible because you have unmerged files." /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org /// -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.