From c394895c4eea4f597f6a734212e5cb5e38c630e7 Mon Sep 17 00:00:00 2001 From: micbou Date: Sat, 31 Dec 2016 09:51:10 +0100 Subject: [PATCH] Fix large file message appearing twice Use PostVimMessage to avoid "Press ENTER or type command to continue" message. --- autoload/youcompleteme.vim | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/autoload/youcompleteme.vim b/autoload/youcompleteme.vim index 80551c3d..9350d6c3 100644 --- a/autoload/youcompleteme.vim +++ b/autoload/youcompleteme.vim @@ -431,13 +431,16 @@ endfunction function! s:DisableOnLargeFile( filename ) + if exists( 'b:ycm_largefile' ) + return + endif + let threshold = g:ycm_disable_for_files_larger_than_kb * 1024 if threshold > 0 && getfsize( a:filename ) > threshold - echohl WarningMsg | - \ echomsg "YouCompleteMe is disabled in this buffer; " . - \ "the file exceeded the max size (see YCM options)." | - \ echohl None + exec s:python_command "vimsupport.PostVimMessage(" + \ "'YouCompleteMe is disabled in this buffer;" + \ "the file exceeded the max size (see YCM options).')" let b:ycm_largefile = 1 endif endfunction