mirror of
https://github.com/leafOfTree/vim-vue-plugin.git
synced 2025-12-09 14:14:46 +08:00
feat: clean code
This commit is contained in:
@@ -15,7 +15,7 @@ se sw=2 ts=2
|
|||||||
|
|
||||||
let s:name = 'vim-vue-plugin'
|
let s:name = 'vim-vue-plugin'
|
||||||
|
|
||||||
let s:debug = exists("g:vim_vue_plugin_use_pug")
|
let s:debug = exists("g:vim_vue_plugin_debug")
|
||||||
\ && g:vim_vue_plugin_debug == 1
|
\ && g:vim_vue_plugin_debug == 1
|
||||||
let s:use_pug = exists("g:vim_vue_plugin_use_pug")
|
let s:use_pug = exists("g:vim_vue_plugin_use_pug")
|
||||||
\ && g:vim_vue_plugin_use_pug == 1
|
\ && g:vim_vue_plugin_use_pug == 1
|
||||||
@@ -40,13 +40,17 @@ runtime! indent/xml.vim
|
|||||||
unlet! b:did_indent
|
unlet! b:did_indent
|
||||||
runtime! indent/css.vim
|
runtime! indent/css.vim
|
||||||
|
|
||||||
" Load pug indent method
|
if s:use_pug
|
||||||
unlet! b:did_indent
|
" Load pug indent method
|
||||||
runtime! indent/pug.vim
|
unlet! b:did_indent
|
||||||
|
runtime! indent/pug.vim
|
||||||
|
endif
|
||||||
|
|
||||||
" Load sass indent method
|
if s:use_sass
|
||||||
unlet! b:did_indent
|
" Load sass indent method
|
||||||
runtime! indent/sass.vim
|
unlet! b:did_indent
|
||||||
|
runtime! indent/sass.vim
|
||||||
|
endif
|
||||||
|
|
||||||
let b:did_indent = 1
|
let b:did_indent = 1
|
||||||
let b:did_vue_indent = 1
|
let b:did_vue_indent = 1
|
||||||
@@ -127,7 +131,7 @@ function! GetVueIndent()
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
if curline =~? s:vue_tag || curline =~? s:vue_end_tag
|
if curline =~? s:vue_tag || curline =~? s:vue_end_tag
|
||||||
call s:LogMsg('current is vue tag')
|
call s:LogMsg('current line is vue tag')
|
||||||
let ind = 0
|
let ind = 0
|
||||||
elseif s:has_init_indent
|
elseif s:has_init_indent
|
||||||
if SynsVueScope(cursyns) && ind == 0
|
if SynsVueScope(cursyns) && ind == 0
|
||||||
@@ -135,7 +139,7 @@ function! GetVueIndent()
|
|||||||
let ind = &sw
|
let ind = &sw
|
||||||
endif
|
endif
|
||||||
elseif prevline =~? s:vue_tag || prevline =~? s:vue_end_tag
|
elseif prevline =~? s:vue_tag || prevline =~? s:vue_end_tag
|
||||||
call s:LogMsg('prev is vue tag')
|
call s:LogMsg('prev line is vue tag')
|
||||||
let ind = 0
|
let ind = 0
|
||||||
endif
|
endif
|
||||||
call s:LogMsg('result indent: '.ind)
|
call s:LogMsg('result indent: '.ind)
|
||||||
|
|||||||
Reference in New Issue
Block a user