From 6c6efeeee59fc64fd4402621459af2571b16a818 Mon Sep 17 00:00:00 2001 From: gmarik Date: Thu, 4 Aug 2011 14:12:13 -0500 Subject: [PATCH] Installer and Search use buffer - instead writing to file and opening it - faster and has nicer status name - TODO unify --- autoload/vundle/installer.vim | 12 +++++++++--- autoload/vundle/scripts.vim | 12 +++++++++--- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/autoload/vundle/installer.vim b/autoload/vundle/installer.vim index c2ec4f1..7bed9e2 100644 --- a/autoload/vundle/installer.vim +++ b/autoload/vundle/installer.vim @@ -23,13 +23,19 @@ func! vundle#installer#new(bang, ...) abort endf func! s:display(headers, results) - if !exists('s:browse') | let s:browse = tempname() | endif + if exists('g:vundle_view') + exec g:vundle_view.'bd!' + endif + let results = map(a:results, ' printf("Bundle! ' ."'%s'".'", v:val) ') - call writefile(a:headers + results, s:browse) - silent pedit `=s:browse` + silent pedit [Vundle] installer wincmd P | wincmd H + let g:vundle_view = bufnr('%') + + call append(0, a:headers + results) + setl ft=vundle call vundle#scripts#setup_view() endf diff --git a/autoload/vundle/scripts.vim b/autoload/vundle/scripts.vim index 57b68e2..c08d543 100644 --- a/autoload/vundle/scripts.vim +++ b/autoload/vundle/scripts.vim @@ -58,13 +58,19 @@ func! s:view_log() endf func! s:display(headers, results) - if !exists('s:browse') | let s:browse = tempname() | endif + if exists('g:vundle_view') + exec g:vundle_view.'bd!' + endif + let results = reverse(map(a:results, ' printf("Bundle ' ."'%s'".'", v:val) ')) - call writefile(a:headers + results, s:browse) - silent pedit `=s:browse` + silent pedit [Vundle] search wincmd P | wincmd H + let g:vundle_view = bufnr('%') + + call append(0, a:headers + results) + setl ft=vundle call vundle#scripts#setup_view() endf