neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit ef1d291f29961ae10cc122e92fb2419cbbd29f3b
parent a122406be48a7a9216eb9afd0fe71ca37e340c30
Author: Gregory Anders <8965202+gpanders@users.noreply.github.com>
Date:   Wed,  9 Nov 2022 16:21:54 -0700

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.
Diffstat:
Mruntime/autoload/provider/clipboard.vim | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 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', '-']