diff options
| author | ckelsel <ckelsel@hotmail.com> | 2017-07-28 08:38:08 +0800 |
|---|---|---|
| committer | ckelsel <ckelsel@hotmail.com> | 2017-07-28 08:38:08 +0800 |
| commit | 3e0536eb295309c728acca386ec35756b7e034f6 (patch) | |
| tree | f4ef3ef657245cf6d96a3d777ae63c6fda5b11d0 /runtime/autoload/provider/pythonx.vim | |
| parent | 31c018244daa12caab3af357a368279a1f55d28c (diff) | |
| parent | e6d54407ba8ce580fbd81cb9389eb9ce4483597b (diff) | |
| download | rneovim-3e0536eb295309c728acca386ec35756b7e034f6.tar.gz rneovim-3e0536eb295309c728acca386ec35756b7e034f6.tar.bz2 rneovim-3e0536eb295309c728acca386ec35756b7e034f6.zip | |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'runtime/autoload/provider/pythonx.vim')
| -rw-r--r-- | runtime/autoload/provider/pythonx.vim | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/runtime/autoload/provider/pythonx.vim b/runtime/autoload/provider/pythonx.vim index 2f64c22c71..7285ed43ea 100644 --- a/runtime/autoload/provider/pythonx.vim +++ b/runtime/autoload/provider/pythonx.vim @@ -5,17 +5,7 @@ endif let s:loaded_pythonx_provider = 1 -let s:stderr = {} -let s:job_opts = {'rpc': v:true} - -" TODO(bfredl): this logic is common and should be builtin -function! s:job_opts.on_stderr(chan_id, data, event) - let stderr = get(s:stderr, a:chan_id, ['']) - let last = remove(stderr, -1) - let a:data[0] = last.a:data[0] - call extend(stderr, a:data) - let s:stderr[a:chan_id] = stderr -endfunction +let s:job_opts = {'rpc': v:true, 'on_stderr': function('provider#stderr_collector')} function! provider#pythonx#Require(host) abort let ver = (a:host.orig_name ==# 'python') ? 2 : 3 @@ -38,9 +28,11 @@ function! provider#pythonx#Require(host) abort catch echomsg v:throwpoint echomsg v:exception - for row in get(s:stderr, channel_id, []) + for row in provider#get_stderr(channel_id) echomsg row endfor + finally + call provider#clear_stderr(channel_id) endtry throw remote#host#LoadErrorForHost(a:host.orig_name, \ '$NVIM_PYTHON_LOG_FILE') |