fix: Wrong comment type; actually return M
This commit is contained in:
parent
c1f894e0f3
commit
123dfb81f9
1 changed files with 8 additions and 6 deletions
|
@ -1,21 +1,23 @@
|
||||||
# https://github.com/folke/lazy.nvim/blob/main/lua/lazy/core/util.lua
|
-- https://github.com/folke/lazy.nvim/blob/main/lua/lazy/core/util.lua
|
||||||
|
|
||||||
---@class lib.lazy.util
|
---@class lib.lazy.util
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
---@return string
|
---@return string
|
||||||
function M.norm(path)
|
function M.norm(path)
|
||||||
if path:sub(1, 1) == "~" then
|
if path:sub(1, 1) == '~' then
|
||||||
local home = vim.uv.os_homedir() or ""
|
local home = vim.uv.os_homedir() or ''
|
||||||
|
|
||||||
if home:sub(-1) == "\\" or home:sub(-1) == '/' then
|
if home:sub(-1) == '\\' or home:sub(-1) == '/' then
|
||||||
home = home:sub(1, -2)
|
home = home:sub(1, -2)
|
||||||
end
|
end
|
||||||
|
|
||||||
path = home .. path:sub(2)
|
path = home .. path:sub(2)
|
||||||
end
|
end
|
||||||
|
|
||||||
path = path:gsub("\\", "/"):gsub("/+", "/")
|
path = path:gsub('\\', '/'):gsub('/+', '/')
|
||||||
|
|
||||||
return path:sub(-1) == "/" and path:sub(1, -2) or path
|
return path:sub(-1) == '/' and path:sub(1, -2) or path
|
||||||
end
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
|
|
Loading…
Reference in a new issue