mirror of
https://github.com/neovim/neovim.git
synced 2025-11-15 23:01:24 +00:00
- Show hint only once per session. - provider#clipboard#Call(): prevent recursion - provider#clear_stderr(): use has_key(), because :silent! is still captured by :redir. closes #7184
21 lines
505 B
VimL
21 lines
505 B
VimL
" Common functionality for providers
|
|
|
|
let s:stderr = {}
|
|
|
|
function! provider#stderr_collector(chan_id, data, event) dict
|
|
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
|