Skip to content

Commit fcdc2d2

Browse files
author
Adriaan Zonnenberg
committed
use 'detect_on_enter' instead of 'auto' and document the option
With posva#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'.
1 parent 3105d62 commit fcdc2d2

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

readme.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,3 +130,9 @@ let g:vue_pre_processors = []
130130
```
131131

132132
Available pre-processors are: coffee, haml, handlebars, less, pug, sass, scss, slm, stylus, typescript
133+
134+
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.
135+
136+
```vim
137+
let g:vue_pre_processors = 'detect_on_enter'
138+
```

syntax/vue.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function! s:should_register(language, start_pattern)
3131
if exists('g:vue_pre_processors')
3232
if type(g:vue_pre_processors) == v:t_list
3333
return index(g:vue_pre_processors, s:language.name) != -1
34-
elseif g:vue_pre_processors is# 'auto'
34+
elseif g:vue_pre_processors is# 'detect_on_enter'
3535
return search(a:start_pattern, 'n') != 0
3636
endif
3737
endif

0 commit comments

Comments
 (0)