diff --git a/autoload/youcompleteme.vim b/autoload/youcompleteme.vim index 2fa69b48..315d91a3 100644 --- a/autoload/youcompleteme.vim +++ b/autoload/youcompleteme.vim @@ -44,6 +44,7 @@ function! youcompleteme#Enable() " initial file. autocmd BufRead,BufEnter * call s:OnBufferVisit() autocmd CursorHold,CursorHoldI * call s:OnCursorHold() + autocmd InsertLeave * call s:OnInsertLeave() augroup END " We need menuone in completeopt, otherwise when there's only one candidate @@ -127,6 +128,10 @@ function! s:OnMovedI() endfunction +function! s:OnInsertLeave() + let s:omnifunc_mode = 0 +endfunction + function! s:IdentifierFinishedOperations() if !pyeval( 'ycm.CurrentIdentifierFinished()' ) return