mirror of
https://github.com/leafOfTree/vim-vue-plugin.git
synced 2025-12-12 07:31:50 +08:00
Support TypeScript indent
This commit is contained in:
@@ -38,6 +38,8 @@ let s:use_sass = exists("g:vim_vue_plugin_use_sass")
|
|||||||
\ && g:vim_vue_plugin_use_sass == 1
|
\ && g:vim_vue_plugin_use_sass == 1
|
||||||
let s:use_coffee = exists("g:vim_vue_plugin_use_coffee")
|
let s:use_coffee = exists("g:vim_vue_plugin_use_coffee")
|
||||||
\ && g:vim_vue_plugin_use_coffee == 1
|
\ && g:vim_vue_plugin_use_coffee == 1
|
||||||
|
let s:use_typescript = exists("g:vim_vue_plugin_use_typescript")
|
||||||
|
\ && g:vim_vue_plugin_use_typescript == 1
|
||||||
|
|
||||||
let s:has_init_indent = 0
|
let s:has_init_indent = 0
|
||||||
if !exists("g:vim_vue_plugin_has_init_indent")
|
if !exists("g:vim_vue_plugin_has_init_indent")
|
||||||
@@ -81,6 +83,11 @@ if s:use_coffee
|
|||||||
unlet! b:did_indent
|
unlet! b:did_indent
|
||||||
runtime! indent/coffee.vim
|
runtime! indent/coffee.vim
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if s:use_typescript
|
||||||
|
unlet! b:did_indent
|
||||||
|
runtime! indent/typescript.vim
|
||||||
|
endif
|
||||||
"}}}
|
"}}}
|
||||||
|
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
@@ -140,6 +147,9 @@ function! GetVueIndent()
|
|||||||
elseif s:SynCoffee(cursyn)
|
elseif s:SynCoffee(cursyn)
|
||||||
call vue#Log('syntax: coffee')
|
call vue#Log('syntax: coffee')
|
||||||
let ind = GetCoffeeIndent(v:lnum)
|
let ind = GetCoffeeIndent(v:lnum)
|
||||||
|
elseif s:SynTypeScript(cursyn)
|
||||||
|
call vue#Log('syntax: typescript')
|
||||||
|
let ind = GetTypescriptIndent()
|
||||||
elseif s:SynSASS(cursyn)
|
elseif s:SynSASS(cursyn)
|
||||||
call vue#Log('syntax: sass')
|
call vue#Log('syntax: sass')
|
||||||
let ind = GetSassIndent()
|
let ind = GetSassIndent()
|
||||||
@@ -197,6 +207,10 @@ function! s:SynCoffee(syn)
|
|||||||
return a:syn ==? 'coffeeVueScript'
|
return a:syn ==? 'coffeeVueScript'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! s:SynTypeScript(syn)
|
||||||
|
return a:syn ==? 'typescriptVueScript'
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! s:SynSASS(syn)
|
function! s:SynSASS(syn)
|
||||||
return a:syn ==? 'cssSassVueStyle'
|
return a:syn ==? 'cssSassVueStyle'
|
||||||
endfunction
|
endfunction
|
||||||
|
|||||||
Reference in New Issue
Block a user