From 6be3cd37eda3857724571a1d77a2cd28d0a99dbd Mon Sep 17 00:00:00 2001 From: Strahinja Val Markovic Date: Wed, 6 Feb 2013 18:46:57 -0800 Subject: [PATCH] Making sure filename exists before using it --- python/completers/cpp/clang_completer.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/python/completers/cpp/clang_completer.py b/python/completers/cpp/clang_completer.py index 1e6873ff..6865d4af 100644 --- a/python/completers/cpp/clang_completer.py +++ b/python/completers/cpp/clang_completer.py @@ -80,6 +80,9 @@ class ClangCompleter( Completer ): def CandidatesForQueryAsync( self, query ): filename = vim.current.buffer.name + if not filename: + return + if self.completer.UpdatingTranslationUnit( filename ): vimsupport.PostVimMessage( 'Still parsing file, no completions yet.' ) self.completions_future = None @@ -125,6 +128,9 @@ class ClangCompleter( Completer ): return filename = vim.current.buffer.name + if not filename: + return + if self.completer.UpdatingTranslationUnit( filename ): return