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

+5
View File
@@ -75,6 +75,11 @@ function! s:GetBlockIndent(syntax)
let indentexpr = get(s:indent, syntax)
if !empty(indentexpr)
let ind = eval(indentexpr)
elseif has_key(s:indent, syntax)
" No indent file for syntax in config, keep indent as cindent may break
" languages like pug or toml
call vue#LogWithLnum('indentexpr not found for '.syntax.', keep indent')
let ind = -1
else
call vue#LogWithLnum('indentexpr not found for '.syntax.', use cindent')
let ind = cindent(v:lnum)