Skip to content

Commit

Permalink
fix(clipboard): update version regex pattern
Browse files Browse the repository at this point in the history
Building tmux from source uses a 'next-' prefix, so account for that.
Also handle failures to match more gracefully.
  • Loading branch information
gpanders committed Nov 9, 2022
1 parent fae7540 commit 51bb65f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions runtime/autoload/provider/clipboard.vim
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ function! provider#clipboard#Executable() abort
let s:paste['*'] = s:paste['+']
return 'termux-clipboard'
elseif !empty($TMUX) && executable('tmux')
let [major, minor] = matchlist(systemlist(['tmux', '-V'])[0], 'tmux \(\d\+\)\.\(\d\+\)')[1:2]
if major > 3 || (major == 3 && minor >= 2)
let ver = matchlist(systemlist(['tmux', '-V'])[0], '\vtmux %(next-)?(\d+)\.(\d+)')
if len(ver) >= 3 && (ver[1] > 3 || (ver[1] == 3 && ver[2] >= 2))
let s:copy['+'] = ['tmux', 'load-buffer', '-w', '-']
else
let s:copy['+'] = ['tmux', 'load-buffer', '-']
Expand Down

0 comments on commit 51bb65f

Please sign in to comment.