Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert try cache with source #342

Merged
merged 2 commits into from Nov 24, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 5 additions & 15 deletions autoload/neobundle/config.vim
Expand Up @@ -165,7 +165,7 @@ function! neobundle#config#source(names, ...) "{{{
catch
call neobundle#util#print_error(
\ '[neobundle] Uncaught error while sourcing "' . bundle.name .
\ '": '.v:exception)
\ '": '.v:exception . ' in ' . v:throwpoint)
endtry
endif

Expand Down Expand Up @@ -630,20 +630,10 @@ function! s:on_source(bundle) "{{{
\ ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin'],
\ "isdirectory(a:bundle.rtp.'/'.v:val)")
for file in split(glob(a:bundle.rtp.'/'.directory.'/**/*.vim'), '\n')
try
execute 'source' fnameescape(file)

catch /^Vim\%((\a\+)\)\=:\%(E122\|E174\|E227\)/
" Catch (kind of expected) errors from sourcing a file multiple times,
" e.g. on update/re-install:
" E122: Function Foo already exists, add ! to replace it
" E174: Command already exists: add ! to replace it
" E227: mapping already exists for ...
catch
call neobundle#util#print_error(
\ '[neobundle] Uncaught error while sourcing "' . file .
\ '": '.v:exception)
endtry
" NOTE: "silent!" is required to ignore E122, E174 and E227.
" try/catching them aborts sourcing of the file.
" "unsilent" then displays any messages while sourcing.
execute 'silent! unsilent source' fnameescape(file)
endfor
endfor

Expand Down