From 5bf9f8c353dbcc45c9eb3197f95eb59b5dac109e Mon Sep 17 00:00:00 2001 From: gmarik Date: Sat, 30 Jul 2011 19:35:16 -0500 Subject: [PATCH] basic logging --- autoload/vundle/installer.vim | 6 ++++++ autoload/vundle/scripts.vim | 13 ++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/autoload/vundle/installer.vim b/autoload/vundle/installer.vim index 5c986ca..62b1b1f 100644 --- a/autoload/vundle/installer.vim +++ b/autoload/vundle/installer.vim @@ -132,4 +132,10 @@ endf func! s:system(cmd) abort let output = system(a:cmd) + call s:log(output) +endf + +func! s:log(str) abort + if !exists('g:vundle_log') | let g:vundle_log = [] | endif + call add(g:vundle_log, a:str) endf diff --git a/autoload/vundle/scripts.vim b/autoload/vundle/scripts.vim index ae7bfdd..eb141a7 100644 --- a/autoload/vundle/scripts.vim +++ b/autoload/vundle/scripts.vim @@ -35,16 +35,27 @@ func! vundle#scripts#setup_view() abort sign define VuOk text=* texthl=String com! -buffer -bang -nargs=? InstallBundle call vundle#installer#install('!' == '', ) + com! -buffer -nargs=0 VundleLog call s:view_log() nnoremap q :wincmd q nnoremap i :exec 'Install'.getline('.') - + + nnoremap l :VundleLog + nnoremap c :BundleClean nnoremap C :BundleClean! nnoremap r :Bundles nnoremap R :call vundle#scripts#reload() endf +func! s:view_log() + if !exists('b:log_file') | let b:log_file = tempname() | endif + call writefile(g:vundle_log, b:log_file) + silent pedit `=b:log_file` + + wincmd P | wincmd H +endf + func! s:display(headers, results) if !exists('s:browse') | let s:browse = tempname() | endif let results = reverse(map(a:results, ' printf("Bundle ' ."'%s'".'", v:val) '))