diff --git a/autoload/youcompleteme.vim b/autoload/youcompleteme.vim index a06c5705..2528f89b 100644 --- a/autoload/youcompleteme.vim +++ b/autoload/youcompleteme.vim @@ -31,7 +31,7 @@ function! youcompleteme#Enable() autocmd! autocmd CursorMovedI * call s:OnMovedI() autocmd BufRead,BufEnter * call s:OnBufferVisit() - autocmd CursorHold,CursorHoldI * py csystem.AddBufferIdentifiers() + autocmd CursorHold,CursorHoldI * call s:OnCursorHold() augroup END " We need menuone in completeopt, otherwise when there's only one candidate @@ -70,6 +70,11 @@ function! s:OnBufferVisit() endfunction +function! s:OnCursorHold() + py csystem.AddBufferIdentifiers() +endfunction + + function! s:SetCompleteFunc() let &completefunc = 'youcompleteme#Complete' let &l:completefunc = 'youcompleteme#Complete'