mirror of
https://github.com/leafOfTree/vim-vue-plugin.git
synced 2025-12-08 13:44:46 +08:00
Improve code format
This commit is contained in:
@@ -36,18 +36,15 @@ endif
|
|||||||
|
|
||||||
function! s:SynsEOL(lnum)
|
function! s:SynsEOL(lnum)
|
||||||
let lnum = prevnonblank(a:lnum)
|
let lnum = prevnonblank(a:lnum)
|
||||||
let col = strlen(getline(lnum))
|
let cnum = strlen(getline(lnum))
|
||||||
return map(synstack(lnum, col), 'synIDattr(v:val, "name")')
|
return map(synstack(lnum, cnum), 'synIDattr(v:val, "name")')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! GetVueSubtype()
|
function! GetVueSubtype()
|
||||||
let lnum = line('.')
|
let lnum = line('.')
|
||||||
let cursyns = s:SynsEOL(lnum)
|
let cursyns = s:SynsEOL(lnum)
|
||||||
if !empty(cursyns)
|
let syn = !empty(cursyns) ? get(cursyns, 0, '') : ''
|
||||||
let syn = get(cursyns, 0, '')
|
|
||||||
else
|
|
||||||
let syn = ''
|
|
||||||
endif
|
|
||||||
let subtype = matchstr(syn, '\w\+\zeVue')
|
let subtype = matchstr(syn, '\w\+\zeVue')
|
||||||
if subtype =~ 'css\w\+'
|
if subtype =~ 'css\w\+'
|
||||||
let subtype = subtype[3:]
|
let subtype = subtype[3:]
|
||||||
@@ -57,11 +54,7 @@ function! GetVueSubtype()
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! GetVueTag(...)
|
function! GetVueTag(...)
|
||||||
if a:0 > 0
|
let lnum = a:0 > 0 ? a:1 : line('.')
|
||||||
let lnum = a:1
|
|
||||||
else
|
|
||||||
let lnum = line('.')
|
|
||||||
endif
|
|
||||||
let cursyns = s:SynsEOL(lnum)
|
let cursyns = s:SynsEOL(lnum)
|
||||||
let syn = get(cursyns, 0, '')
|
let syn = get(cursyns, 0, '')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user