feat: allow opting in to builtin clipboard providers (#28083)

Setting `vim.g.clipboard = false` will use the builtin clipboard
providers.

Closes https://github.com/neovim/neovim/issues/27698.

Co-authored-by: Gregory Anders <greg@gpanders.com>
This commit is contained in:
dundargoc 2024-03-28 21:17:08 +01:00 committed by GitHub
parent cff8c15977
commit 0ebc4de0ff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -67,7 +67,8 @@ function! provider#clipboard#Error() abort
endfunction
function! provider#clipboard#Executable() abort
if exists('g:clipboard')
" Setting g:clipboard to v:false explicitly opts-in to using the "builtin" clipboard providers below
if exists('g:clipboard') && g:clipboard isnot# v:false
if type({}) isnot# type(g:clipboard)
\ || type({}) isnot# type(get(g:clipboard, 'copy', v:null))
\ || type({}) isnot# type(get(g:clipboard, 'paste', v:null))