Skip to content

Commit

Permalink
fix(util): fixed double slashes
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Dec 20, 2022
1 parent 62c1542 commit af87108
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lua/lazy/core/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ end

function M.norm(path)
if path:sub(1, 1) == "~" then
path = vim.loop.os_homedir() .. "/" .. path:sub(2)
local home = vim.loop.os_homedir()
if home:sub(-1) == "\\" or home:sub(-1) == "/" then
home = home:sub(1, -2)
end
path = home .. path:sub(2)
end
return path:gsub("\\", "/")
end
Expand Down

0 comments on commit af87108

Please sign in to comment.