Skip to content

Commit

Permalink
fix(clipboard): update version regex pattern (neovim#21012)
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 authored and yesean committed Mar 25, 2023
1 parent 8650263 commit c25f3dc
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 c25f3dc

Please sign in to comment.