mirror of
https://github.com/leafOfTree/vim-vue-plugin.git
synced 2025-12-08 21:54:46 +08:00
Fix indent after empty tag
This commit is contained in:
@@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user