mirror of https://github.com/folke/lazy.nvim.git
feat: utility method to normalize a path
This commit is contained in:
parent
a18988372f
commit
198963fdab
|
@ -27,6 +27,13 @@ function M.track(data, time)
|
|||
end
|
||||
end
|
||||
|
||||
function M.norm(path)
|
||||
if path:sub(1, 1) == "~" then
|
||||
path = vim.loop.os_homedir() .. "/" .. path:sub(2)
|
||||
end
|
||||
return path:gsub("\\", "/")
|
||||
end
|
||||
|
||||
function M.try(fn, msg)
|
||||
-- error handler
|
||||
local error_handler = function(err)
|
||||
|
|
Loading…
Reference in New Issue