mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-19 21:06:46 +00:00
feat: utility method to normalize a path
This commit is contained in:
parent
a18988372f
commit
198963fdab
1 changed files with 7 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue