From 81444e207c3bdf398490f13f57ea360371d56be1 Mon Sep 17 00:00:00 2001 From: Strahinja Val Markovic Date: Fri, 8 Mar 2013 22:55:14 -0800 Subject: [PATCH] Don't run when there's no filetype set. Implements the smaller part of issue #178. --- autoload/youcompleteme.vim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/autoload/youcompleteme.vim b/autoload/youcompleteme.vim index a685d168..3b440a55 100644 --- a/autoload/youcompleteme.vim +++ b/autoload/youcompleteme.vim @@ -136,9 +136,12 @@ 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, &filetype, 0 ) + return !get( g:ycm_filetypes_to_completely_ignore, current_filetype, 0 ) endfunction