aboutsummaryrefslogtreecommitdiff
path: root/runtime/autoload
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2023-03-17 01:12:33 +0100
committerJustin M. Keyes <justinkz@gmail.com>2023-03-20 13:40:38 +0100
commita40eb7cc991eb4f8b89f467e8e42563868efa76b (patch)
tree8e6da1b0500ea0b11a97c1a0472204bdf4d4fc16 /runtime/autoload
parenta715e6f87eede36775d0921b3537c7c57a82890a (diff)
downloadrneovim-a40eb7cc991eb4f8b89f467e8e42563868efa76b.tar.gz
rneovim-a40eb7cc991eb4f8b89f467e8e42563868efa76b.tar.bz2
rneovim-a40eb7cc991eb4f8b89f467e8e42563868efa76b.zip
feat(vim.version): more coercion with strict=false
Problem: "tmux 3.2a" (output from "tmux -V") is not parsed easily. Solution: With `strict=false`, discard everything before the first digit. - rename Semver => Version - rename vim.version.version() => vim.version._version() - rename matches() => has() - remove `opts` from cmp()
Diffstat (limited to 'runtime/autoload')
-rw-r--r--runtime/autoload/provider/clipboard.vim4
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/autoload/provider/clipboard.vim b/runtime/autoload/provider/clipboard.vim
index 98c80f1843..6d238ddb55 100644
--- a/runtime/autoload/provider/clipboard.vim
+++ b/runtime/autoload/provider/clipboard.vim
@@ -145,8 +145,8 @@ function! provider#clipboard#Executable() abort
let s:paste['*'] = s:paste['+']
return 'termux-clipboard'
elseif !empty($TMUX) && executable('tmux')
- 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 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', '-']
else
let s:copy['+'] = ['tmux', 'load-buffer', '-']