simpify s:ModeMapAllowsAutoChecking()
This commit is contained in:
parent
d13264513d
commit
2c6b271321
@ -190,24 +190,16 @@ endfunction
|
|||||||
"check the current filetypes against g:syntastic_mode_map to determine whether
|
"check the current filetypes against g:syntastic_mode_map to determine whether
|
||||||
"active mode syntax checking should be done
|
"active mode syntax checking should be done
|
||||||
function! s:ModeMapAllowsAutoChecking()
|
function! s:ModeMapAllowsAutoChecking()
|
||||||
|
let fts = split(&ft, '\.')
|
||||||
|
|
||||||
if g:syntastic_mode_map['mode'] == 'passive'
|
if g:syntastic_mode_map['mode'] == 'passive'
|
||||||
|
|
||||||
"check at least one filetype is active
|
"check at least one filetype is active
|
||||||
for ft in split(&ft, '\.')
|
let actives = g:syntastic_mode_map["active_filetypes"]
|
||||||
if index(g:syntastic_mode_map['active_filetypes'], ft) != -1
|
return !empty(filter(fts, 'index(actives, v:val) != -1'))
|
||||||
return 1
|
|
||||||
endif
|
|
||||||
return 0
|
|
||||||
endfor
|
|
||||||
else
|
else
|
||||||
|
|
||||||
"check no filetypes are passive
|
"check no filetypes are passive
|
||||||
for ft in split(&ft, '\.')
|
let passives = g:syntastic_mode_map["passive_filetypes"]
|
||||||
if index(g:syntastic_mode_map['passive_filetypes'], ft) != -1
|
return empty(filter(fts, 'index(passives, v:val) != -1'))
|
||||||
return 0
|
|
||||||
endif
|
|
||||||
return 1
|
|
||||||
endfor
|
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user