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:
leafOfTree committed 2026-10-21 13:51:38 +00:00
1 parent 824aff651d
commit de9fbec1ad
5 files changed
+43 -2

No files matched your search

+4
View File
@@ -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'