mirror of
https://github.com/posva/vim-vue.git
synced 2025-12-08 10:24:45 +08:00
Deprecate g:vue_disable_pre_processors
It was superseded by g:vue_pre_processors (#133) I could add a message if g:vue_disable_pre_processors is set, asking people to update their config to the new variable, but I'd rather not interrupt people's workflows.
This commit is contained in:
@@ -119,8 +119,8 @@ When checking for pre-processor languages, multiple syntax highlighting checks a
|
|||||||
let g:vue_pre_processors = ['pug', 'scss']
|
let g:vue_pre_processors = ['pug', 'scss']
|
||||||
```
|
```
|
||||||
|
|
||||||
Or alternatively, disable pre-processor languages altogether:
|
To disable pre-processor languages altogether (only highlight HTML, JavaScript, and CSS):
|
||||||
|
|
||||||
```vim
|
```vim
|
||||||
let g:vue_disable_pre_processors = 1
|
let g:vue_pre_processors = []
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -6,6 +6,11 @@ if exists("b:current_syntax")
|
|||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" Convert deprecated variable to new one
|
||||||
|
if exists('g:vue_disable_pre_processors') && g:vue_disable_pre_processors
|
||||||
|
let g:vue_pre_processors = []
|
||||||
|
endif
|
||||||
|
|
||||||
runtime! syntax/html.vim
|
runtime! syntax/html.vim
|
||||||
syntax clear htmlTagName
|
syntax clear htmlTagName
|
||||||
syntax match htmlTagName contained "\<[a-zA-Z0-9:-]*\>"
|
syntax match htmlTagName contained "\<[a-zA-Z0-9:-]*\>"
|
||||||
@@ -59,20 +64,18 @@ for item in s:language_config
|
|||||||
let s:language_dict[item.lang] = item.args
|
let s:language_dict[item.lang] = item.args
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
if !exists("g:vue_disable_pre_processors") || !g:vue_disable_pre_processors
|
if exists("g:vue_pre_processors")
|
||||||
if exists("g:vue_pre_processors")
|
let pre_processors = g:vue_pre_processors
|
||||||
let pre_processors = g:vue_pre_processors
|
else
|
||||||
else
|
let pre_processors = map(copy(s:language_config), {k, v -> v.lang})
|
||||||
let pre_processors = map(copy(s:language_config), {k, v -> v.lang})
|
|
||||||
endif
|
|
||||||
|
|
||||||
for language in pre_processors
|
|
||||||
if has_key(s:language_dict, language)
|
|
||||||
call call("s:register_language", get(s:language_dict, language))
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
for language in pre_processors
|
||||||
|
if has_key(s:language_dict, language)
|
||||||
|
call call("s:register_language", get(s:language_dict, language))
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
syn region vueSurroundingTag contained start=+<\(script\|style\|template\)+ end=+>+ fold contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent
|
syn region vueSurroundingTag contained start=+<\(script\|style\|template\)+ end=+>+ fold contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent
|
||||||
syn keyword htmlSpecialTagName contained template
|
syn keyword htmlSpecialTagName contained template
|
||||||
syn keyword htmlArg contained scoped ts
|
syn keyword htmlArg contained scoped ts
|
||||||
|
|||||||
Reference in New Issue
Block a user