mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
provider: delete vimL stderr collector, now that it exists builtin
This commit is contained in:
parent
91b856ccce
commit
0de019b6a6
@ -1,20 +0,0 @@
|
|||||||
" Common functionality for providers
|
|
||||||
|
|
||||||
let s:stderr = {}
|
|
||||||
|
|
||||||
function! provider#stderr_collector(chan_id, data, event)
|
|
||||||
let stderr = get(s:stderr, a:chan_id, [''])
|
|
||||||
let stderr[-1] .= a:data[0]
|
|
||||||
call extend(stderr, a:data[1:])
|
|
||||||
let s:stderr[a:chan_id] = stderr
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! provider#clear_stderr(chan_id)
|
|
||||||
if has_key(s:stderr, a:chan_id)
|
|
||||||
call remove(s:stderr, a:chan_id)
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! provider#get_stderr(chan_id)
|
|
||||||
return get(s:stderr, a:chan_id, [])
|
|
||||||
endfunction
|
|
@ -7,7 +7,7 @@ let s:clipboard = {}
|
|||||||
|
|
||||||
" When caching is enabled, store the jobid of the xclip/xsel process keeping
|
" When caching is enabled, store the jobid of the xclip/xsel process keeping
|
||||||
" ownership of the selection, so we know how long the cache is valid.
|
" ownership of the selection, so we know how long the cache is valid.
|
||||||
let s:selection = { 'owner': 0, 'data': [], 'on_stderr': function('provider#stderr_collector') }
|
let s:selection = { 'owner': 0, 'data': [], 'stderr_buffered': v:true }
|
||||||
|
|
||||||
function! s:selection.on_exit(jobid, data, event) abort
|
function! s:selection.on_exit(jobid, data, event) abort
|
||||||
" At this point this nvim instance might already have launched
|
" At this point this nvim instance might already have launched
|
||||||
@ -16,12 +16,10 @@ function! s:selection.on_exit(jobid, data, event) abort
|
|||||||
let self.owner = 0
|
let self.owner = 0
|
||||||
endif
|
endif
|
||||||
if a:data != 0
|
if a:data != 0
|
||||||
let stderr = provider#get_stderr(a:jobid)
|
|
||||||
echohl WarningMsg
|
echohl WarningMsg
|
||||||
echomsg 'clipboard: error invoking '.get(self.argv, 0, '?').': '.join(stderr)
|
echomsg 'clipboard: error invoking '.get(self.argv, 0, '?').': '.join(self.stderr)
|
||||||
echohl None
|
echohl None
|
||||||
endif
|
endif
|
||||||
call provider#clear_stderr(a:jobid)
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
let s:selections = { '*': s:selection, '+': copy(s:selection) }
|
let s:selections = { '*': s:selection, '+': copy(s:selection) }
|
||||||
|
@ -3,7 +3,7 @@ if exists('g:loaded_node_provider')
|
|||||||
endif
|
endif
|
||||||
let g:loaded_node_provider = 1
|
let g:loaded_node_provider = 1
|
||||||
|
|
||||||
let s:job_opts = {'rpc': v:true, 'on_stderr': function('provider#stderr_collector')}
|
let s:job_opts = {'rpc': v:true, 'stderr_buffered': v:true}
|
||||||
|
|
||||||
function! provider#node#Detect() abort
|
function! provider#node#Detect() abort
|
||||||
return has('win32') ? exepath('neovim-node-host.cmd') : exepath('neovim-node-host')
|
return has('win32') ? exepath('neovim-node-host.cmd') : exepath('neovim-node-host')
|
||||||
@ -32,19 +32,18 @@ function! provider#node#Require(host) abort
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
try
|
try
|
||||||
let channel_id = jobstart(args, s:job_opts)
|
let job = copy(s:job_opts)
|
||||||
|
let channel_id = jobstart(args, job)
|
||||||
if rpcrequest(channel_id, 'poll') ==# 'ok'
|
if rpcrequest(channel_id, 'poll') ==# 'ok'
|
||||||
return channel_id
|
return channel_id
|
||||||
endif
|
endif
|
||||||
catch
|
catch
|
||||||
echomsg v:throwpoint
|
echomsg v:throwpoint
|
||||||
echomsg v:exception
|
echomsg v:exception
|
||||||
for row in provider#get_stderr(channel_id)
|
for row in job.stderr
|
||||||
echomsg row
|
echomsg row
|
||||||
endfor
|
endfor
|
||||||
endtry
|
endtry
|
||||||
finally
|
|
||||||
call provider#clear_stderr(channel_id)
|
|
||||||
endtry
|
endtry
|
||||||
throw remote#host#LoadErrorForHost(a:host.orig_name, '$NVIM_NODE_LOG_FILE')
|
throw remote#host#LoadErrorForHost(a:host.orig_name, '$NVIM_NODE_LOG_FILE')
|
||||||
endfunction
|
endfunction
|
||||||
|
@ -5,7 +5,7 @@ endif
|
|||||||
|
|
||||||
let s:loaded_pythonx_provider = 1
|
let s:loaded_pythonx_provider = 1
|
||||||
|
|
||||||
let s:job_opts = {'rpc': v:true, 'on_stderr': function('provider#stderr_collector')}
|
let s:job_opts = {'rpc': v:true, 'stderr_buffered': v:true}
|
||||||
|
|
||||||
function! provider#pythonx#Require(host) abort
|
function! provider#pythonx#Require(host) abort
|
||||||
let ver = (a:host.orig_name ==# 'python') ? 2 : 3
|
let ver = (a:host.orig_name ==# 'python') ? 2 : 3
|
||||||
@ -21,18 +21,17 @@ function! provider#pythonx#Require(host) abort
|
|||||||
endfor
|
endfor
|
||||||
|
|
||||||
try
|
try
|
||||||
let channel_id = jobstart(args, s:job_opts)
|
let job = copy(s:job_opts)
|
||||||
|
let channel_id = jobstart(args, job)
|
||||||
if rpcrequest(channel_id, 'poll') ==# 'ok'
|
if rpcrequest(channel_id, 'poll') ==# 'ok'
|
||||||
return channel_id
|
return channel_id
|
||||||
endif
|
endif
|
||||||
catch
|
catch
|
||||||
echomsg v:throwpoint
|
echomsg v:throwpoint
|
||||||
echomsg v:exception
|
echomsg v:exception
|
||||||
for row in provider#get_stderr(channel_id)
|
for row in job.stderr
|
||||||
echomsg row
|
echomsg row
|
||||||
endfor
|
endfor
|
||||||
finally
|
|
||||||
call provider#clear_stderr(channel_id)
|
|
||||||
endtry
|
endtry
|
||||||
throw remote#host#LoadErrorForHost(a:host.orig_name,
|
throw remote#host#LoadErrorForHost(a:host.orig_name,
|
||||||
\ '$NVIM_PYTHON_LOG_FILE')
|
\ '$NVIM_PYTHON_LOG_FILE')
|
||||||
|
Loading…
Reference in New Issue
Block a user