Removing YCM as omnifunc if no native support

This commit is contained in:
Strahinja Val Markovic 2013-02-11 21:45:42 -08:00
parent 786e6182ff
commit 5d89aef907

View File

@ -194,6 +194,13 @@ function! s:SetCompleteFunc()
if pyeval( 'ycm_state.NativeFiletypeCompletionUsable()' )
let &omnifunc = 'youcompleteme#OmniComplete'
let &l:omnifunc = 'youcompleteme#OmniComplete'
" If we don't have native filetype support but the omnifunc is set to YCM's
" omnifunc because the previous file the user was editing DID have native
" support, we remove our omnifunc.
elseif &omnifunc == 'youcompleteme#OmniComplete'
let &omnifunc = ''
let &l:omnifunc = ''
endif
endfunction