From e5c99428f3789f1db81221773178d527e0375dd8 Mon Sep 17 00:00:00 2001 From: Stanislav Golovanov Date: Thu, 9 May 2013 19:58:44 +0400 Subject: [PATCH] fix IndexError when min_num_of_chars is set to 0 Fixes #307. Error is thrown when g:ycm_min_num_of_chars_for_completion option is set to 0 user tries to delete an identifier which starts at the beginning of the line. --- python/completers/general/filename_completer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/completers/general/filename_completer.py b/python/completers/general/filename_completer.py index da5de7f2..01af4382 100644 --- a/python/completers/general/filename_completer.py +++ b/python/completers/general/filename_completer.py @@ -63,8 +63,8 @@ class FilenameCompleter( ThreadedCompleter ): def ShouldUseNowInner( self, start_column ): - return ( vim.current.line[ start_column - 1 ] == '/' or - self.AtIncludeStatementStart( start_column ) ) + return ( start_column and ( vim.current.line[ start_column - 1 ] == '/' or + self.AtIncludeStatementStart( start_column ) ) ) def SupportedFiletypes( self ):