From cd79e99746e794d0b4706efa72b038ae4dbaad8e Mon Sep 17 00:00:00 2001 From: micbou Date: Wed, 22 Feb 2017 14:20:46 +0100 Subject: [PATCH] Use gui_running instead of gui has('gui') returns 1 even in console Vim if it is compiled with +gui. --- plugin/youcompleteme.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/youcompleteme.vim b/plugin/youcompleteme.vim index 194a8614..11c87d78 100644 --- a/plugin/youcompleteme.vim +++ b/plugin/youcompleteme.vim @@ -128,7 +128,7 @@ let g:ycm_goto_buffer_command = let g:ycm_disable_for_files_larger_than_kb = \ get( g:, 'ycm_disable_for_files_larger_than_kb', 1000 ) -if has( 'vim_starting' ) && has( 'gui' ) " loading at startup, in gui +if has( 'vim_starting' ) && has( 'gui_running' ) " Loading at startup, in gui. " We defer loading until after VimEnter to allow the gui to fork (see " `:h gui-fork`) and avoid a deadlock situation, as explained here: " https://github.com/Valloric/YouCompleteMe/pull/2473#issuecomment-267716136 @@ -136,7 +136,7 @@ if has( 'vim_starting' ) && has( 'gui' ) " loading at startup, in gui autocmd! autocmd VimEnter * call youcompleteme#Enable() augroup END -else " manual loading with :packadd, or not starting the gui +else " Manual loading with :packadd, or not starting the gui. call youcompleteme#Enable() endif