File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -223,6 +223,16 @@ function M.compare_pre(version, req)
223223 return - 1
224224 end
225225
226+ --- @param str string
227+ --- @return string[]
228+ local function split_identifiers (str )
229+ local parts = {}
230+ for part in str :gmatch (" [^%.]+" ) do
231+ table.insert (parts , part )
232+ end
233+ return parts
234+ end
235+
226236 --- @param str string
227237 --- @return boolean
228238 local function is_numeric (str )
@@ -248,8 +258,8 @@ function M.compare_pre(version, req)
248258 end
249259 end
250260
251- local version_parts = version and vim . split (version , " . " ) or {}
252- local req_parts = req and vim . split (req , " . " ) or {}
261+ local version_parts = version and split_identifiers (version ) or {}
262+ local req_parts = req and split_identifiers (req ) or {}
253263
254264 local max_len = math.max (# version_parts , # req_parts )
255265
You can’t perform that action at this time.
0 commit comments