mirror of
https://github.com/neovim/neovim.git
synced 2025-09-13 23:08:16 +00:00
clipboard: support clipboard=unnamedplus,unnamed
This commit is contained in:
@@ -55,13 +55,21 @@ endif
|
||||
let s:clipboard = {}
|
||||
|
||||
function! s:clipboard.get(reg)
|
||||
if s:selections[a:reg].owner > 0
|
||||
return s:selections[a:reg].data
|
||||
let reg = a:reg == '"' ? '+' : a:reg
|
||||
if s:selections[reg].owner > 0
|
||||
return s:selections[reg].data
|
||||
end
|
||||
return s:try_cmd(s:paste[a:reg])
|
||||
return s:try_cmd(s:paste[reg])
|
||||
endfunction
|
||||
|
||||
function! s:clipboard.set(lines, regtype, reg)
|
||||
if a:reg == '"'
|
||||
call s:clipboard.set(a:lines,a:regtype,'+')
|
||||
if s:copy['*'] != s:copy['+']
|
||||
call s:clipboard.set(a:lines,a:regtype,'*')
|
||||
end
|
||||
return 0
|
||||
end
|
||||
if s:cache_enabled == 0
|
||||
call s:try_cmd(s:copy[a:reg], a:lines)
|
||||
return 0
|
||||
|
@@ -1402,8 +1402,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
register '*' for all yank, delete, change and put
|
||||
operations which would normally go to the unnamed
|
||||
register. When "unnamed" is also included to the
|
||||
option, yank operations (but not delete, change or
|
||||
put) will additionally copy the text into register
|
||||
option, yank and delete operations (but not put)
|
||||
will additionally copy the text into register
|
||||
'*'. See |nvim-clipboard|.
|
||||
<
|
||||
*clipboard-autoselect*
|
||||
|
Reference in New Issue
Block a user