aboutsummaryrefslogtreecommitdiff
path: root/neovim/patch/0001-fix-provider-compare-versions-as-number-not-string-1.patch
blob: 1b7e5a32bd202a7bd7ab0883e6e369e031be7a12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From e16adbf238ee46b59b68a84af17bdee10ca49418 Mon Sep 17 00:00:00 2001
From: "Tejasvi S. Tomar" <45873379+tejasvi@users.noreply.github.com>
Date: Fri, 8 Oct 2021 02:57:40 +0530
Subject: [PATCH 1/1] fix(provider): compare versions as number, not string
 #15937

"3.10" < "3.3" but v3.10 > v3.3
Fixes #14586
---
 runtime/autoload/provider/pythonx.vim | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/runtime/autoload/provider/pythonx.vim b/runtime/autoload/provider/pythonx.vim
index c292b374b..0eeb35cba 100644
--- a/runtime/autoload/provider/pythonx.vim
+++ b/runtime/autoload/provider/pythonx.vim
@@ -96,7 +96,7 @@ function! provider#pythonx#CheckForModule(prog, module, major_version) abort
     if prog_version !~ '^' . a:major_version
       return [0, prog_path . ' is Python ' . prog_version . ' and cannot provide Python '
             \ . a:major_version . '.']
-    elseif prog_version =~ '^' . a:major_version && prog_version < min_version
+    elseif prog_version =~ '^' . a:major_version && str2nr(prog_version[2:]) < str2nr(min_version[2:])
       return [0, prog_path . ' is Python ' . prog_version . ' and cannot provide Python >= '
             \ . min_version . '.']
     endif
-- 
2.33.1