diff options
author | Shougo Matsushita <Shougo.Matsu@gmail.com> | 2016-06-20 19:56:02 +0900 |
---|---|---|
committer | Shougo Matsushita <Shougo.Matsu@gmail.com> | 2016-06-20 19:56:02 +0900 |
commit | 367df6d67322d9b1f3958bd1998eeee9233914ba (patch) | |
tree | 85629c5612e5c42b9ea89fac1aac6ce19b8f5914 /autoload | |
parent | 5d267d546f44e621ab0580117c8e61d0cbd8ceac (diff) | |
download | deoplete.nvim-367df6d67322d9b1f3958bd1998eeee9233914ba.zip |
Use capture() if available
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/deoplete/util.vim | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/autoload/deoplete/util.vim b/autoload/deoplete/util.vim index 4097be8..68b6d13 100644 --- a/autoload/deoplete/util.vim +++ b/autoload/deoplete/util.vim @@ -123,13 +123,17 @@ function! deoplete#util#uniq(list) abort "{{{ endfunction"}}} function! deoplete#util#redir(cmd) abort "{{{ - let [save_verbose, save_verbosefile] = [&verbose, &verbosefile] - set verbose=0 verbosefile= - redir => res - silent! execute a:cmd - redir END - let [&verbose, &verbosefile] = [save_verbose, save_verbosefile] - return res + if exists('*capture') + return capture(a:cmd) + else + let [save_verbose, save_verbosefile] = [&verbose, &verbosefile] + set verbose=0 verbosefile= + redir => res + silent! execute a:cmd + redir END + let [&verbose, &verbosefile] = [save_verbose, save_verbosefile] + return res + endif endfunction"}}} function! deoplete#util#get_syn_name() abort "{{{ |