From ad4091635ea22b1a08aa8281a1e6c5a6538482b2 Mon Sep 17 00:00:00 2001 From: Andrea Cedraro Date: Thu, 31 Dec 2015 00:12:38 +0100 Subject: [PATCH] Add comment expaning why we defer setting the omnifunc --- autoload/youcompleteme.vim | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/autoload/youcompleteme.vim b/autoload/youcompleteme.vim index 7e4c8488..20902939 100644 --- a/autoload/youcompleteme.vim +++ b/autoload/youcompleteme.vim @@ -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!