Просмотр исходного кода

Merge pull request #3749 from bstaletic/master

[READY] Make the popup preview check stricter
mergify[bot] 4 лет назад
Родитель
Сommit
2afee9d977
1 измененных файлов с 5 добавлено и 1 удалено
  1. 5 1
      autoload/youcompleteme.vim

+ 5 - 1
autoload/youcompleteme.vim

@@ -505,7 +505,11 @@ function! s:SetUpCompleteopt()
   " Also, having this option set breaks the plugin.
   set completeopt-=longest
 
-  if g:ycm_add_preview_to_completeopt ==# 'popup' && 
+  " A non-numeric string compares equal to an integer zero. Without the type
+  " check, users on a recent vim and disabling preview by setting it to 0
+  " get `popup` added instead.
+  if type( g:ycm_add_preview_to_completeopt ) == type( '' ) &&
+	\ g:ycm_add_preview_to_completeopt ==# 'popup' && 
         \ ( v:version > 801 || ( v:version == 801 && has( 'patch1880' ) ) )
     set completeopt+=popup
   elseif g:ycm_add_preview_to_completeopt