summaryrefslogtreecommitdiffstats
path: root/autoload
diff options
context:
space:
mode:
Diffstat (limited to 'autoload')
-rw-r--r--autoload/polyglot/detect.vim22
1 files changed, 17 insertions, 5 deletions
diff --git a/autoload/polyglot/detect.vim b/autoload/polyglot/detect.vim
index b1b5d6d7..cac826cf 100644
--- a/autoload/polyglot/detect.vim
+++ b/autoload/polyglot/detect.vim
@@ -53,16 +53,16 @@ func! polyglot#detect#H(...)
for lnum in range(1, min([line("$"), 200]))
let line = getline(lnum)
if line =~# '^\s*\(@\(interface\|class\|protocol\|property\|end\|synchronised\|selector\|implementation\)\(\<\|\>\)\|#import\s\+.\+\.h[">]\)'
- if exists("g:c_syntax_for_h")
+ if exists('g:c_syntax_for_h')
set ft=objc | return
endif
set ft=objcpp | return
endif
endfor
- if exists("g:c_syntax_for_h")
+ if exists('g:c_syntax_for_h')
set ft=c | return
endif
- if exists("g:ch_syntax_for_h")
+ if exists('g:ch_syntax_for_h')
set ft=ch | return
endif
set ft=cpp | return
@@ -82,7 +82,14 @@ func! polyglot#detect#M(...)
set ft=objc | return
endif
if line =~# '^\s*%'
- set ft=octave | return
+ if !has_key(g:polyglot_is_disabled, 'octave')
+ set ft=octave | return
+ endif
+ endif
+ if line =~# '^\s*%'
+ if has_key(g:polyglot_is_disabled, 'octave')
+ set ft=matlab | return
+ endif
endif
if line =~# '^\s*(\*'
set ft=mma | return
@@ -97,7 +104,12 @@ func! polyglot#detect#M(...)
if exists("g:filetype_m")
let &ft = g:filetype_m | return
endif
- set ft=octave | return
+ if !has_key(g:polyglot_is_disabled, 'octave')
+ set ft=octave | return
+ endif
+ if has_key(g:polyglot_is_disabled, 'octave')
+ set ft=matlab | return
+ endif
endfunc
func! polyglot#detect#Fs(...)