From acbba74fe2537c784bb8908abe230db60808f201 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Wed, 9 Apr 2014 00:40:19 +0900 Subject: [PATCH] Fix output format (#17) --- plug.vim | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/plug.vim b/plug.vim index dc5aab2..a2effb7 100644 --- a/plug.vim +++ b/plug.vim @@ -261,7 +261,7 @@ function! s:syntax() syn match plugX /x/ containedin=plug2 contained syn match plugDash /^-/ syn match plugName /\(^- \)\@<=[^:]*/ - syn match plugRelDate /([^)]\+)$/ + syn match plugRelDate /([^)/+-]\{3,})$/ syn match plugSha /^ [0-9a-z]\{7}/ syn match plugError /^x.*/ syn keyword Function PlugInstall PlugStatus PlugUpdate PlugClean @@ -773,6 +773,7 @@ function! s:diff() call s:prepare() call append(0, 'Collecting updated changes ...') + let cnt = 0 for [k, v] in items(g:plugs) if !isdirectory(v.dir) continue @@ -784,13 +785,19 @@ function! s:diff() call append(1, '') call append(2, '- '.k.':') call append(3, map(split(diff, '\n'), '" ". v:val')) + let cnt += 1 normal! gg redraw endif cd - endfor - call setline(1, 'Updated changes:') + if cnt == 0 + call setline(1, 'No update.') + else + call setline(1, 'Updated changes:') + endif + normal! gg endfunction let &cpo = s:cpo_save