Skip to content

Commit

Permalink
Add comment expaning why we defer setting the omnifunc
Browse files Browse the repository at this point in the history
  • Loading branch information
vheon committed Dec 30, 2015
1 parent b4beed4 commit ad40916
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions autoload/youcompleteme.vim
Expand Up @@ -89,6 +89,12 @@ function! youcompleteme#Enable()
autocmd CompleteDone * call s:OnCompleteDone()
augroup END

" Setting the omnifunc require us to ask the server if it has a Native
" Semantic Completer for the current buffer's filetype. When vim first start
" this mean that we have to wait for the server to be up and running which
" would block vim's GUI. To avoid this we defer setting the omnifunc the
" first time to when we enter Insert mode and then update it on every
" BufferVisit as normal.
if s:defer_omnifunc
augroup ycm_defer_omnifunc
autocmd!
Expand Down

0 comments on commit ad40916

Please sign in to comment.