mirror of
https://github.com/leafOfTree/vim-vue-plugin.git
synced 2026-11-02 18:37:34 +08:00
Merge syntax config per block
syntax in g:vim_vue_plugin_config replaced the whole default, so
{'syntax': {'script': ['javascript', 'typescript']}} removed template
and style, which then had no highlight or indent. Replace the default
of each key separately, like vim-svelte-plugin. A block can be removed
by setting it to [].
This commit is contained in:
5 files changed
+36
-3
No files matched your search
+7
-1
@@ -28,10 +28,16 @@ function! s:MergeUserConfigIntoDefault(user)
|
||||
\'debug': 0,
|
||||
\}
|
||||
|
||||
" Each key of syntax replaces the default of the same key, so blocks not in
|
||||
" user config keep their default syntax
|
||||
let user = a:user
|
||||
for key in keys(default)
|
||||
if has_key(user, key)
|
||||
let default[key] = user[key]
|
||||
if key ==# 'syntax' && type(user[key]) == v:t_dict
|
||||
call extend(default[key], user[key])
|
||||
else
|
||||
let default[key] = user[key]
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
|
||||
|
||||
Reference in new issue
Block a user