Support coffee indent

This commit is contained in:
leafOfTree
2019-08-29 11:34:50 +08:00
parent 082174fa23
commit 02c545c691
2 changed files with 61 additions and 36 deletions

View File

@@ -38,6 +38,9 @@ let s:use_pug = exists("g:vim_vue_plugin_use_pug")
\ && g:vim_vue_plugin_use_pug == 1
let s:use_sass = exists("g:vim_vue_plugin_use_sass")
\ && g:vim_vue_plugin_use_sass == 1
let s:use_coffee = exists("g:vim_vue_plugin_use_coffee")
\ && g:vim_vue_plugin_use_coffee == 1
let s:has_init_indent = 0
if !exists("g:vim_vue_plugin_has_init_indent")
let ext = expand("%:e")
@@ -73,6 +76,11 @@ if s:use_sass
unlet! b:did_indent
runtime! indent/sass.vim
endif
if s:use_coffee
unlet! b:did_indent
runtime! indent/coffee.vim
endif
"}}}
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
@@ -129,6 +137,9 @@ function! GetVueIndent()
elseif s:SynPug(prevsyn)
call s:Log('syntax: pug')
let ind = GetPugIndent()
elseif s:SynCoffee(prevsyn)
call s:Log('syntax: coffee')
let ind = GetCoffeeIndent(v:lnum)
elseif s:SynSASS(prevsyn)
call s:Log('syntax: sass')
let ind = GetSassIndent()
@@ -180,6 +191,10 @@ function! s:SynPug(syn)
return a:syn ==? 'pugVueTemplate'
endfunction
function! s:SynCoffee(syn)
return a:syn ==? 'coffeeVueScript'
endfunction
function! s:SynSASS(syn)
return a:syn ==? 'cssSassVueStyle'
endfunction