aboutsummaryrefslogtreecommitdiff
path: root/runtime/autoload
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/autoload')
-rw-r--r--runtime/autoload/provider/clipboard.vim8
1 files changed, 8 insertions, 0 deletions
diff --git a/runtime/autoload/provider/clipboard.vim b/runtime/autoload/provider/clipboard.vim
index 848fa401f1..0bfd82f61d 100644
--- a/runtime/autoload/provider/clipboard.vim
+++ b/runtime/autoload/provider/clipboard.vim
@@ -169,6 +169,14 @@ function! provider#clipboard#Executable() abort
let s:copy['*'] = s:copy['+']
let s:paste['*'] = s:paste['+']
return 'tmux'
+ elseif get(get(g:, 'termfeatures', {}), 'osc52') && &clipboard ==# ''
+ " Don't use OSC 52 when 'clipboard' is set. It can be slow and cause a lot
+ " of user prompts. Users can opt-in to it by setting g:clipboard manually.
+ let s:copy['+'] = v:lua.require'vim.ui.clipboard.osc52'.copy('+')
+ let s:copy['*'] = v:lua.require'vim.ui.clipboard.osc52'.copy('*')
+ let s:paste['+'] = v:lua.require'vim.ui.clipboard.osc52'.paste('+')
+ let s:paste['*'] = v:lua.require'vim.ui.clipboard.osc52'.paste('*')
+ return 'OSC 52'
endif
let s:err = 'clipboard: No clipboard tool. :help clipboard'