From 82bd32aa16cc5304a287a5472cd8c8e9e22f04cc Mon Sep 17 00:00:00 2001 From: Strahinja Val Markovic Date: Sat, 9 Mar 2013 09:47:35 -0800 Subject: [PATCH] Fixing YCM breakage VimScript is not Python so "!some_string" does not return false when some_string is not empty (it _does_ return true when some_string _is_ empty). I of course know this, but my fingers like to forget it from time to time. --- autoload/youcompleteme.vim | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/autoload/youcompleteme.vim b/autoload/youcompleteme.vim index 3b440a55..a0375485 100644 --- a/autoload/youcompleteme.vim +++ b/autoload/youcompleteme.vim @@ -136,12 +136,10 @@ endfunction function! s:AllowedToCompleteInCurrentFile() - let current_filetype = &filetype - if !current_filetype - return 0 " If the user set the current filetype as a filetype that YCM should ignore, " then we don't do anything - return !get( g:ycm_filetypes_to_completely_ignore, current_filetype, 0 ) + return !empty( &filetype ) && + \ !get( g:ycm_filetypes_to_completely_ignore, &filetype, 0 ) endfunction