Don't set omnifunc when not allowed
This commit is contained in:
parent
4f2494e87e
commit
30def5d246
@ -108,9 +108,7 @@ function! youcompleteme#Enable()
|
||||
if s:defer_omnifunc
|
||||
augroup ycm_defer_omnifunc
|
||||
autocmd!
|
||||
autocmd InsertEnter * call s:SetOmnicompleteFunc()
|
||||
\ | let s:defer_omnifunc = 0
|
||||
\ | autocmd! ycm_defer_omnifunc
|
||||
autocmd InsertEnter * call s:DeferredUntilInsertEnter()
|
||||
augroup END
|
||||
endif
|
||||
|
||||
@ -121,6 +119,14 @@ function! youcompleteme#Enable()
|
||||
call s:OnBufferRead()
|
||||
endfunction
|
||||
|
||||
function s:DeferredUntilInsertEnter()
|
||||
let s:defer_omnifunc = 0
|
||||
autocmd! ycm_defer_omnifunc
|
||||
|
||||
if s:AllowedToCompleteInCurrentFile()
|
||||
call s:SetOmnicompleteFunc()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! youcompleteme#EnableCursorMovedAutocommands()
|
||||
augroup ycmcompletemecursormove
|
||||
|
Loading…
Reference in New Issue
Block a user