From 0868aef516a9cea4bf979e786187b983bf881f26 Mon Sep 17 00:00:00 2001 From: "Augusto F. Hack" Date: Sun, 19 Aug 2018 17:04:55 -0300 Subject: [PATCH] added type check for g:ycm_filetype_blacklist --- autoload/youcompleteme.vim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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