From cea707fc13795ca1973ccacdeaa6f4a64acbaf31 Mon Sep 17 00:00:00 2001 From: Strahinja Val Markovic Date: Sat, 23 Mar 2013 14:11:48 -0700 Subject: [PATCH] Fixing errors throw in "[Command Line]" window Fixes #202. --- autoload/youcompleteme.vim | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/autoload/youcompleteme.vim b/autoload/youcompleteme.vim index e0aa4565..8fb9c14d 100644 --- a/autoload/youcompleteme.vim +++ b/autoload/youcompleteme.vim @@ -322,6 +322,15 @@ endfunction function! s:ClosePreviewWindowIfNeeded() + let current_buffer_name = bufname('') + + " We don't want to try to close the preview window in special buffers like + " "[Command Line]"; if we do, Vim goes bonkers. Special buffers always start + " with '['. + if current_buffer_name[ 0 ] == '[' + return + endif + if s:searched_and_results_found " This command does the actual closing of the preview window. If no preview " window is shown, nothing happens.