diff --git a/autoload/youcompleteme.vim b/autoload/youcompleteme.vim index 0cbf8f0c..d6460a83 100644 --- a/autoload/youcompleteme.vim +++ b/autoload/youcompleteme.vim @@ -21,7 +21,7 @@ set cpo&vim " This needs to be called outside of a function let s:script_folder_path = escape( expand( ':p:h' ), '\' ) -let s:searched_and_no_results_found = 0 +let s:searched_and_results_found = 0 let s:should_use_filetype_completion = 0 let s:completion_start_column = 0 let s:omnifunc_mode = 0 @@ -167,7 +167,7 @@ function! s:ClosePreviewWindowIfNeeded() return endif - if !s:searched_and_no_results_found + if s:searched_and_results_found " This command does the actual closing of the preview window. If no preview " window is shown, nothing happens. pclose @@ -249,13 +249,13 @@ function! s:CompletionsForQuery( query, use_filetype_completer ) while !l:results_ready let l:results_ready = pyeval( 'completer.AsyncCandidateRequestReady()' ) if complete_check() - let s:searched_and_no_results_found = 1 + let s:searched_and_results_found = 0 return { 'words' : [], 'refresh' : 'always'} endif endwhile let l:results = pyeval( 'completer.CandidatesFromStoredRequest()' ) - let s:searched_and_no_results_found = len( l:results ) == 0 + let s:searched_and_results_found = len( l:results ) != 0 return { 'words' : l:results, 'refresh' : 'always' } endfunction diff --git a/python/completers/cpp/clang_completer.py b/python/completers/cpp/clang_completer.py index b0c0887b..a0f5bf7a 100644 --- a/python/completers/cpp/clang_completer.py +++ b/python/completers/cpp/clang_completer.py @@ -137,6 +137,7 @@ class ClangCompleter( Completer ): return ShouldUseClang( start_column ) +# TODO: make these functions module-local def CompletionDataToDict( completion_data ): # see :h complete-items for a description of the dictionary fields return {