diff options
author | Gregory Anders <8965202+gpanders@users.noreply.github.com> | 2022-11-09 16:21:54 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-09 16:21:54 -0700 |
commit | ef1d291f29961ae10cc122e92fb2419cbbd29f3b (patch) | |
tree | cb75ae3d36a5556f3aee1ce1eeb4534cb9b3e378 | |
parent | a122406be48a7a9216eb9afd0fe71ca37e340c30 (diff) | |
download | rneovim-ef1d291f29961ae10cc122e92fb2419cbbd29f3b.tar.gz rneovim-ef1d291f29961ae10cc122e92fb2419cbbd29f3b.tar.bz2 rneovim-ef1d291f29961ae10cc122e92fb2419cbbd29f3b.zip |
fix(clipboard): update version regex pattern (#21012)
Building tmux from source uses a 'next-' prefix, so account for that.
Also handle failures to match more gracefully.
-rw-r--r-- | runtime/autoload/provider/clipboard.vim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/autoload/provider/clipboard.vim b/runtime/autoload/provider/clipboard.vim index e4161290d9..de8f2cbdf2 100644 --- a/runtime/autoload/provider/clipboard.vim +++ b/runtime/autoload/provider/clipboard.vim @@ -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', '-'] |