fix(path_shorten): use first path when glob mathes multiple paths

This commit is contained in:
bhagwan 2022-06-08 18:16:02 -07:00
parent 59069a393b
commit 870f88096b

View File

@ -142,7 +142,7 @@ end
function M.lengthen(path)
return vim.fn.glob(path:gsub(M.separator(), "%*"..M.separator())
-- remove the starting '*/' if any
:gsub("^%*"..M.separator(), M.separator()))
:gsub("^%*"..M.separator(), M.separator())):match("[^\n]+")
end
local function lastIndexOf(haystack, needle)