mirror of
https://github.com/leafOfTree/vim-vue-plugin.git
synced 2025-12-07 21:24:50 +08:00
chore: add helper
This commit is contained in:
@@ -43,14 +43,14 @@ runtime! indent/xml.vim
|
||||
unlet! b:did_indent
|
||||
runtime! indent/css.vim
|
||||
|
||||
" Load pug indent method
|
||||
if s:use_pug
|
||||
" Load pug indent method
|
||||
unlet! b:did_indent
|
||||
runtime! indent/pug.vim
|
||||
endif
|
||||
|
||||
" Load sass indent method
|
||||
if s:use_sass
|
||||
" Load sass indent method
|
||||
unlet! b:did_indent
|
||||
runtime! indent/sass.vim
|
||||
endif
|
||||
@@ -96,6 +96,24 @@ function! s:SynsVueScope(syns)
|
||||
return first_syn =~? '\v^(vueStyle)|(vueScript)'
|
||||
endfunction
|
||||
|
||||
function! GetVueCurrentTag()
|
||||
let lnum = getcurpos()[1]
|
||||
let cursyns = s:SynsEOL(lnum)
|
||||
let first_syn = get(cursyns, 0)
|
||||
|
||||
if first_syn =~ 'vueTemplate.*'
|
||||
let tag = 'template'
|
||||
elseif first_syn =~ 'vueScript.*'
|
||||
let tag = 'script'
|
||||
elseif first_syn =~ 'vueStyle.*'
|
||||
let tag = 'style'
|
||||
else
|
||||
let tag = ''
|
||||
endif
|
||||
|
||||
return tag
|
||||
endfunction
|
||||
|
||||
function! GetVueIndent()
|
||||
let curline = getline(v:lnum)
|
||||
let prevline = getline(v:lnum - 1)
|
||||
|
||||
Reference in New Issue
Block a user