From 97d4520c5027bdc6fcde06c4a8b3aaa99c5d10fa Mon Sep 17 00:00:00 2001 From: gmarik Date: Sat, 13 Aug 2011 19:19:34 -0500 Subject: [PATCH] improve :BundleClean --- autoload/vundle/installer.vim | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/autoload/vundle/installer.vim b/autoload/vundle/installer.vim index bfb241a..390e147 100644 --- a/autoload/vundle/installer.vim +++ b/autoload/vundle/installer.vim @@ -92,18 +92,18 @@ func! vundle#installer#clean(bang) abort let x_dirs = filter(all_dirs, '0 > index(bundle_dirs, v:val)') if empty(x_dirs) - echo "All clean!" - return + let headers = ['" All clean!'] + let names = [] + else + let headers = ['"Remove those bundles?'] + let names = map(copy(x_dirs), 'fnamemodify(v:val, ":t")') end - let names = map(copy(x_dirs), 'fnamemodify(v:val, ":t")') - call vundle#scripts#view('clean', ['"Remove those bundles?'], names) + call vundle#scripts#view('clean', headers, names) redraw! - if (a:bang || input('Are you sure you want to remove '.len(names).' bundles? [ y/n ]:') =~? 'y') - + if (a:bang || empty(names) || input('Are you sure you want to remove '.len(names).' bundles? [ y/n ]:') =~? 'y') call s:process(a:bang, 'delete', names) - echo 'Done!' endif endf