Skip to content

Commit b5bd319

Browse files
Fix vim-plug post-update screen clutter
1 parent 9ab50bb commit b5bd319

5 files changed

Lines changed: 13 additions & 13 deletions

File tree

core/autoload/spacevim.vim

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,3 +243,11 @@ function! spacevim#load_any(...) abort
243243
endfor
244244
return 0
245245
endfunction
246+
247+
function! spacevim#VimPlugPostUpdateHook(make, cmd, info) abort
248+
if spacevim#load('programming')
249+
execute('AsyncRun -mode=term -pos=tab '.(a:make?'-program=make ':'').'@ '.a:cmd)
250+
else
251+
call system(a:cmd)
252+
endif
253+
endfunction

core/autoload/spacevim/plug/youcompleteme.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function! spacevim#plug#youcompleteme#build(info)
1818
if a:info.status ==# 'installed' || a:info.force
1919
" Prefer python3
2020
call insert(args, executable('python3') ? '!python3' : '!python')
21-
execute join(args, ' ')
21+
call spacevim#VimPlugPostUpdateHook(v:false, join(args, ' '), a:info)
2222
endif
2323
endfunction
2424

layers/+completion/deoplete/packages.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ endif
1010
MP 'eagletmt/neco-ghc'
1111
MP 'Shougo/neco-vim'
1212
MP 'sebastianmarkow/deoplete-rust'
13-
MP 'zchee/deoplete-go', { 'do': 'make' }
13+
MP 'zchee/deoplete-go', { 'do': function('spacevim#VimPlugPostUpdateHook', [v:true, '']) }

layers/+tools/fzf/packages.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ elseif g:spacevim.gui && !has('terminal')
55
MP 'Yggdroot/LeaderF'
66
else
77
if g:spacevim.speed_up_via_timer
8-
MP 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all', 'on': [] }
8+
MP 'junegunn/fzf', { 'dir': '~/.fzf', 'do': function('spacevim#VimPlugPostUpdateHook', [v:false, './install --all']), 'on': [] }
99
MP 'junegunn/fzf.vim', { 'on': [] }
1010
call timer_start(700, 'spacevim#defer#fzf')
1111
else
12-
MP 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
12+
MP 'junegunn/fzf', { 'dir': '~/.fzf', 'do': function('spacevim#VimPlugPostUpdateHook', [v:false, './install --all']) }
1313
MP 'junegunn/fzf.vim'
1414
endif
1515
endif

layers/+tools/lsp/packages.vim

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,10 @@ endfunction
2020
function! s:lcn() abort
2121
MP 'autozimu/LanguageClient-neovim', {
2222
\ 'branch': 'next',
23-
\ 'do': function('Install_LanguageClient_neovim'),
23+
\ 'do': function('spacevim#VimPlugPostUpdateHook', [v:false, 'bash install.sh']),
2424
\ }
2525
endfunction
2626

27-
function! Install_LanguageClient_neovim(info)
28-
if spacevim#load('programming')
29-
execute('AsyncRun -mode=term -pos=tab @ bash install.sh')
30-
else
31-
execute('bash install.sh')
32-
endif
33-
endfunction
34-
3527
let g:spacevim_lsp_engine = get(g:, 'spacevim_lsp_engine', 'lcn')
3628

3729
call s:{g:spacevim_lsp_engine}()

0 commit comments

Comments
 (0)