mirror of
https://github.com/leafOfTree/vim-vue-plugin.git
synced 2026-11-02 18:37:34 +08:00
Handle syntax without syntax or indent files
A syntax in the config without a syntax file, like postcss, showed E484 on opening a file. Skip loading it, with a warning in debug. A syntax without an indent file used cindent, which broke indent of languages like pug, stylus without their plugins, or toml. Keep the indent instead. Lines outside blocks still use cindent.
This commit is contained in:
5 files changed
+43
-2
No files matched your search
@@ -263,6 +263,10 @@ endfunction
|
||||
" Load all syntax files in 'runtimepath'
|
||||
" Useful if there is no default syntax file provided by vim
|
||||
function! vue#LoadFullSyntax(group, syntax)
|
||||
if empty(globpath(&runtimepath, 'syntax/'.a:syntax.'.vim'))
|
||||
call vue#Warn(a:syntax.': syntax not found in runtimepath')
|
||||
return
|
||||
endif
|
||||
call vue#Log(a:syntax.': load full')
|
||||
call s:SetCurrentSyntax(a:syntax)
|
||||
execute 'syntax include '.a:group.' syntax/'.a:syntax.'.vim'
|
||||
|
||||
Reference in new issue
Block a user