Fix indent after empty tag

This commit is contained in:
leafOfTree
2020-07-17 09:05:13 +08:00
parent b22a41fb6b
commit 1d99d84ef2

View File

@@ -26,6 +26,7 @@ let s:empty_tag_start = '\v\<'.s:empty_tagname.'[^\>]*$'
let s:empty_tag_end = '\v^\s*[^\<\>\/]*\/?\>\s*' let s:empty_tag_end = '\v^\s*[^\<\>\/]*\/?\>\s*'
let s:tag_start = '\v^\s*\<\w*' let s:tag_start = '\v^\s*\<\w*'
let s:tag_end = '\v^\s*\/?\>\s*' let s:tag_end = '\v^\s*\/?\>\s*'
let s:full_tag_end = '\v^\s*\<\/'
"}}} "}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
@@ -149,9 +150,13 @@ function! GetVueIndent()
let [start, end] = s:PrevMultilineEmptyTag(v:lnum) let [start, end] = s:PrevMultilineEmptyTag(v:lnum)
if end == prevlnum if end == prevlnum
call vue#Log('previous line is a multiline empty tag') call vue#Log('previous line is a multiline empty tag')
if curline =~? s:full_tag_end
let ind = indent(v:lnum - 1) - &sw
else
let ind = indent(v:lnum - 1) let ind = indent(v:lnum - 1)
endif endif
endif endif
endif
elseif s:SynPug(cursyn) elseif s:SynPug(cursyn)
call vue#Log('syntax: pug') call vue#Log('syntax: pug')
let ind = GetPugIndent() let ind = GetPugIndent()