From 300176ba9fcbbcf6ca34c1a0b8590da7a4eb6438 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Mon, 28 Jul 2014 01:27:30 +0900 Subject: [PATCH] Avoid echoerr inside catch block --- plug.vim | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plug.vim b/plug.vim index c335088..9491cfb 100644 --- a/plug.vim +++ b/plug.vim @@ -295,6 +295,7 @@ function! s:add(force, repo, ...) return endif + let exception = '' try let [name, spec] = s:build_plug_spec(a:repo, a:000) @@ -310,9 +311,11 @@ function! s:add(force, repo, ...) let g:plugs[name] = spec let g:plugs_order += [name] catch - echoerr v:exception - return + let exception = v:exception endtry + if !empty(exception) + echoerr exception + endif endfunction function! s:build_plug_spec(repo, opts)