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:
Adriaan Zonnenberg
2019-07-24 20:57:50 +02:00
parent 6acff7e6db
commit 18c4211bd6
2 changed files with 17 additions and 14 deletions

View File

@@ -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 = []
``` ```

View File

@@ -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,19 +64,17 @@ 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 endif
for language in pre_processors for language in pre_processors
if has_key(s:language_dict, language) if has_key(s:language_dict, language)
call call("s:register_language", get(s:language_dict, language)) call call("s:register_language", get(s:language_dict, language))
endif endif
endfor endfor
endif
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