From 3c75a829d54eefdf1b3bc1099ffdb3b8a7e50ed9 Mon Sep 17 00:00:00 2001 From: yemai Date: Wed, 10 Oct 2018 13:59:11 +0800 Subject: [PATCH] fix: correct indentation of multiline tags --- after/indent/vue.vim | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/after/indent/vue.vim b/after/indent/vue.vim index 16eb164..79e7780 100644 --- a/after/indent/vue.vim +++ b/after/indent/vue.vim @@ -34,7 +34,7 @@ setlocal indentkeys+=*,<>>,<<>,/ let s:vue_tag = '\v\<\/?(template|script|style)' let s:vue_tag_no_indent = '\v\<\/?(script|style)' -let s:end_tag = '^\s*\/\?>\s*;\=' +let s:end_tag = '^\s*\/\?>\s*' setlocal indentexpr=GetVueIndent() @@ -81,6 +81,11 @@ function! GetVueIndent() if curline =~? s:end_tag let ind = ind - &sw endif + " Then correct the indentation of any element following '/>' or '>'. + if prevline =~? s:end_tag + let ind = ind + &sw + endif + elseif SynsCSSish(prevsyns) call LogMsg('type: css') let ind = GetCSSIndent()