diff options
author | wzy <32936898+Freed-Wu@users.noreply.github.com> | 2024-12-03 21:06:54 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-03 05:06:54 -0800 |
commit | 2495e7e22a0d56911d3677a17de3ff946b68a9a1 (patch) | |
tree | 0c3a59e8b722b5292d0034c7bd185fa99b452cea | |
parent | 0e299ebf75591b262d659704e84e3d5e7fc2aed9 (diff) | |
download | rneovim-2495e7e22a0d56911d3677a17de3ff946b68a9a1.tar.gz rneovim-2495e7e22a0d56911d3677a17de3ff946b68a9a1.tar.bz2 rneovim-2495e7e22a0d56911d3677a17de3ff946b68a9a1.zip |
fix(clipboard): tmux clipboard depends on $TMUX #31268
Problem:
tmux clipboard not used when tmux is a daemon and $TMUX is empty.
Solution:
If `tmux list-buffers` succeeds, use tmux clipboard.
-rw-r--r-- | runtime/autoload/provider/clipboard.vim | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/autoload/provider/clipboard.vim b/runtime/autoload/provider/clipboard.vim index 58d3d4550f..848fa401f1 100644 --- a/runtime/autoload/provider/clipboard.vim +++ b/runtime/autoload/provider/clipboard.vim @@ -158,7 +158,7 @@ function! provider#clipboard#Executable() abort let s:copy['*'] = s:copy['+'] let s:paste['*'] = s:paste['+'] return 'termux-clipboard' - elseif !empty($TMUX) && executable('tmux') + elseif executable('tmux') && (!empty($TMUX) || 0 == jobwait([jobstart(['tmux', 'list-buffers'])], 2000)[0]) let tmux_v = v:lua.vim.version.parse(system(['tmux', '-V'])) if !empty(tmux_v) && !v:lua.vim.version.lt(tmux_v, [3,2,0]) let s:copy['+'] = ['tmux', 'load-buffer', '-w', '-'] |