diff --git a/autoload/youcompleteme.vim b/autoload/youcompleteme.vim index f8eadb36..172b4f04 100644 --- a/autoload/youcompleteme.vim +++ b/autoload/youcompleteme.vim @@ -403,9 +403,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