mirror of
https://github.com/posva/vim-vue.git
synced 2025-12-08 02:14:43 +08:00
use 'detect_on_enter' instead of 'auto' and document the option
With #128, I can imagine some people don't want vim-vue to scan for new languages on each text change event. So instead of only having an 'auto' option, users will be able to choose between 'detect_on_enter' and 'detect_on_change'.
This commit is contained in:
@@ -130,3 +130,9 @@ let g:vue_pre_processors = []
|
|||||||
```
|
```
|
||||||
|
|
||||||
Available pre-processors are: coffee, haml, handlebars, less, pug, sass, scss, slm, stylus, typescript
|
Available pre-processors are: coffee, haml, handlebars, less, pug, sass, scss, slm, stylus, typescript
|
||||||
|
|
||||||
|
When `g:vue_pre_processors` is set to 'detect_on_enter' instead of a list, vim-vue will detect the pre-processors used when a file is opened, and load only their syntax files.
|
||||||
|
|
||||||
|
```vim
|
||||||
|
let g:vue_pre_processors = 'detect_on_enter'
|
||||||
|
```
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ function! s:should_register(language, start_pattern)
|
|||||||
if exists('g:vue_pre_processors')
|
if exists('g:vue_pre_processors')
|
||||||
if type(g:vue_pre_processors) == v:t_list
|
if type(g:vue_pre_processors) == v:t_list
|
||||||
return index(g:vue_pre_processors, s:language.name) != -1
|
return index(g:vue_pre_processors, s:language.name) != -1
|
||||||
elseif g:vue_pre_processors is# 'auto'
|
elseif g:vue_pre_processors is# 'detect_on_enter'
|
||||||
return search(a:start_pattern, 'n') != 0
|
return search(a:start_pattern, 'n') != 0
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|||||||
Reference in New Issue
Block a user