mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-10 21:42:31 +08:00
Fix parsing the third part of version string (#2355)
* Fix parsing the third part of version string * Add test * Test: fix checking cached version
This commit is contained in:
@@ -14,10 +14,10 @@ function! ale#semver#GetVersion(executable, version_lines) abort
|
||||
let l:version = get(s:version_cache, a:executable, [])
|
||||
|
||||
for l:line in a:version_lines
|
||||
let l:match = matchlist(l:line, '\v(\d+)\.(\d+)\.?(\d?)')
|
||||
let l:match = matchlist(l:line, '\v(\d+)\.(\d+)(\.(\d+))?')
|
||||
|
||||
if !empty(l:match)
|
||||
let l:version = [l:match[1] + 0, l:match[2] + 0, l:match[3] + 0]
|
||||
let l:version = [l:match[1] + 0, l:match[2] + 0, l:match[4] + 0]
|
||||
let s:version_cache[a:executable] = l:version
|
||||
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user