mirror of
https://github.com/leafOfTree/vim-vue-plugin.git
synced 2026-11-02 10:27: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
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user