summaryrefslogtreecommitdiffstats
path: root/ftdetect
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2020-09-23 23:49:57 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2020-09-23 23:49:57 +0200
commit50aa05bd7223bf8887c1b66d092c5177c061c812 (patch)
tree625afa6cc6daa9e1144b44aef10c46b845ee45a6 /ftdetect
parent7e2d060f880a2d1d8e4742e27709869425983335 (diff)
downloadvim-polyglot-4.11.0.tar.gz
vim-polyglot-4.11.0.zip
Allow to disable only syntax highlighting, #556v4.11.0
Diffstat (limited to 'ftdetect')
-rw-r--r--ftdetect/polyglot.vim13
1 files changed, 12 insertions, 1 deletions
diff --git a/ftdetect/polyglot.vim b/ftdetect/polyglot.vim
index ba187f91..f9b6a670 100644
--- a/ftdetect/polyglot.vim
+++ b/ftdetect/polyglot.vim
@@ -8,10 +8,15 @@ if exists('g:polyglot_test')
endif
let s:disabled_packages = {}
+let s:new_polyglot_disabled = []
if exists('g:polyglot_disabled')
for pkg in g:polyglot_disabled
- let s:disabled_packages[pkg] = 1
+ let base = split(pkg, '\.')
+ if len(base) > 0
+ let s:disabled_packages[pkg] = 1
+ call add(s:new_polyglot_disabled, base[0])
+ endif
endfor
else
let g:polyglot_disabled_not_set = 1
@@ -2227,6 +2232,12 @@ endfunc
au BufEnter * if &ft == "" && expand("<afile>") !~ g:ft_ignore_pat
\ | call s:observe_filetype() | endif
+
+" Save polyglot_disabled without postfixes
+if exists('g:polyglot_disabled')
+ let g:polyglot_disabled = s:new_polyglot_disabled
+endif
+
" restore Vi compatibility settings
let &cpo = s:cpo_save
unlet s:cpo_save