Add support for PRIMARY clipboard

This commit is contained in:
Greg V
2018-01-02 22:38:35 +03:00
parent 30b7fc87e1
commit 53516f0d9c
3 changed files with 21 additions and 9 deletions

View File

@@ -1,15 +1,15 @@
" A Neovim plugin that implements GUI helper commands
if !has('nvim') || exists('g:GuiLoaded')
finish
finish
endif
let g:GuiLoaded = 1
if exists('g:GuiInternalClipboard')
function! provider#clipboard#Call(method, args) abort
if a:method == 'get'
return [rpcrequest(1, 'Gui', 'Clipboard', 'Get'), 'v']
return [rpcrequest(1, 'Gui', 'Clipboard', 'Get', a:args[0]), 'v']
elseif a:method == 'set'
call rpcnotify(1, 'Gui', 'Clipboard', 'Set', join(a:args[0], '
call rpcnotify(1, 'Gui', 'Clipboard', 'Set', a:args[2], join(a:args[0], '
'))
endif
endfunction