Browse Source

Reordering some YCM init logic

Strahinja Val Markovic 11 năm trước cách đây
mục cha
commit
496fe8f7a3
1 tập tin đã thay đổi với 13 bổ sung13 xóa
  1. 13 13
      autoload/youcompleteme.vim

+ 13 - 13
autoload/youcompleteme.vim

@@ -51,6 +51,19 @@ function! youcompleteme#Enable()
     return
   endif
 
+  call s:SetUpCpoptions()
+  call s:SetUpCompleteopt()
+  call s:SetUpKeyMappings()
+  call s:SetUpBackwardsCompatibility()
+
+  if g:ycm_register_as_syntastic_checker
+    call s:ForceSyntasticCFamilyChecker()
+  endif
+
+  if g:ycm_allow_changing_updatetime
+    set ut=2000
+  endif
+
   py from ycm.youcompleteme import YouCompleteMe
   py ycm_state = YouCompleteMe()
 
@@ -71,19 +84,6 @@ function! youcompleteme#Enable()
     autocmd VimLeave * call s:OnVimLeave()
   augroup END
 
-  call s:SetUpCpoptions()
-  call s:SetUpCompleteopt()
-  call s:SetUpKeyMappings()
-  call s:SetUpBackwardsCompatibility()
-
-  if g:ycm_register_as_syntastic_checker
-    call s:ForceSyntasticCFamilyChecker()
-  endif
-
-  if g:ycm_allow_changing_updatetime
-    set ut=2000
-  endif
-
   " Calling this once solves the problem of BufRead/BufEnter not triggering for
   " the first loaded file. This should be the last command executed in this
   " function!