mirror of
https://github.com/leafOfTree/vim-vue-plugin.git
synced 2025-12-09 06:04:46 +08:00
fix: correct indentation of multiline tags
This commit is contained in:
@@ -34,7 +34,7 @@ setlocal indentkeys+=*<Return>,<>>,<<>,/
|
||||
|
||||
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()
|
||||
|
||||
Reference in New Issue
Block a user