diff --git a/autoload/youcompleteme.vim b/autoload/youcompleteme.vim index 4e9d149e..5f56f40e 100644 --- a/autoload/youcompleteme.vim +++ b/autoload/youcompleteme.vim @@ -414,9 +414,11 @@ function! s:AllowedToCompleteInBuffer( buffer ) return 0 endif - let whitelist_allows = has_key( g:ycm_filetype_whitelist, '*' ) || + let whitelist_allows = type( g:ycm_filetype_whitelist ) != type( {} ) || + \ has_key( g:ycm_filetype_whitelist, '*' ) || \ has_key( g:ycm_filetype_whitelist, buffer_filetype ) - let blacklist_allows = !has_key( g:ycm_filetype_blacklist, buffer_filetype ) + let blacklist_allows = type( g:ycm_filetype_blacklist ) != type( {} ) || + \ !has_key( g:ycm_filetype_blacklist, buffer_filetype ) let allowed = whitelist_allows && blacklist_allows if allowed