I’m seeing unexpected behavior in the interaction between the system clipboard and registers.
With the system clipboard enabled, the output of :reg becomes corrupted.
Most registers no longer appear in :reg, leaving only "+ and "/, which also seem to be overwritten or contain unexpected data.
func Available()
return v:true
endfunc
func Copy(reg, type, str)
echom "Register: " .. a:reg
echom "Register type: " .. a:type
echom "Contents: " .. string(a:str)
endfunc
func Paste(reg)
return ("b40", ["this", "is", "the", a:reg, "register!"])
endfunc
let v:clipproviders["test"] = {
\ "available": function("Available"),
\ "copy": {
\ "+": function("Copy"),
\ "*": function("Copy")
\ },
\ "paste": {
\ "+": function("Paste"),
\ "*": function("Paste")
\ }
\ }
set clipmethod^=test
set clipboard=unnamed,unnamedplus
Then register contents look incorrect
:reg
Type Name Content
l "+ let g:loaded_netrw = 1^Jfunc Available()^J return v:true^Jendfunc^J^Jfunc Copy(reg, type, str)^J echom "Register: " .. a:reg^J echom "Register type: " .. a:type^J echom "Contents:
l "+ let g:loaded_netrw = 1^Jfunc Available()^J return v:true^Jendfunc^J^Jfunc Copy(reg, type, str)^J echom "Register: " .. a:reg^J echom "Register type: " .. a:type^J echom "Contents:
l "+ set clipboard=unnamed,unnamedplus^J
l "+ ^J
l "+ vim9script^J
l "+ ^J
l "+ ^J
l "+ echom 'PB_Available called'^J
l "+ echom 'PB_Paste called for register: ' .. reg^J
l "+ echom 'PB_Copy called for register: ' .. reg .. ' with regtype: ' .. regtype^J
l "+ type: string^J description: A description of the fave.^J example: "A brief description of the fave."^J
c "+ wwi: struct{}^[la^M^[l
c "+ ^C^C
c "+ ja ^[
c "+ set
b "+ this^Jis^Jthe^J*^Jregister!
b "+ this^Jis^Jthe^J+^Jregister!
c "% fuga.vim
c "/ pb
:reg
Type Name Content
l "" let g:loaded_netrw = 1^Jfunc Available()^J return v:true^Jendfunc^J^Jfunc Copy(reg, type, str)^J echom "Register: " .. a:reg^J echom "Register type: " .. a:type^J echom "Contents:
l "0 let g:loaded_netrw = 1^Jfunc Available()^J return v:true^Jendfunc^J^Jfunc Copy(reg, type, str)^J echom "Register: " .. a:reg^J echom "Register type: " .. a:type^J echom "Contents:
l "1 set clipboard=unnamed,unnamedplus^J
l "2 ^J
l "3 vim9script^J
l "4 ^J
l "5 ^J
l "6 echom 'PB_Available called'^J
l "7 echom 'PB_Paste called for register: ' .. reg^J
l "8 echom 'PB_Copy called for register: ' .. reg .. ' with regtype: ' .. regtype^J
l "9 type: string^J description: A description of the fave.^J example: "A brief description of the fave."^J
c "a wwi: struct{}^[la^M^[l
c "j ^C^C
c "q ja ^[
c "- set
c "* a820a4540d2186208ba11f99a0cea878cb443e6a
c "/ pb
OS: macOS 15.6.1(24G90)
$TERM: xterm-256color
$SHELL: /bin/zsh
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Closed #18988 as completed via 11c3c62.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()