mirror of
https://github.com/neovim/neovim.git
synced 2026-01-04 10:26:42 +10:00
Revert "provider: delete vimL stderr collector, now that it exists builtin"
This change exposed a memory issue with buffered channels, possibly
involving GC. Revert until it has been fixed.
This reverts commit 0de019b6a6.
This commit is contained in:
20
runtime/autoload/provider.vim
Normal file
20
runtime/autoload/provider.vim
Normal file
@@ -0,0 +1,20 @@
|
||||
" 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
|
||||
Reference in New Issue
Block a user