From 123dfb81f91323a44c528a698e8d91166bfc130f Mon Sep 17 00:00:00 2001 From: punkfairie Date: Thu, 28 Nov 2024 21:20:54 -0800 Subject: [PATCH] fix: Wrong comment type; actually return M --- nvim/lua/lib/lazy/util.lua | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/nvim/lua/lib/lazy/util.lua b/nvim/lua/lib/lazy/util.lua index b71ee06..4c95522 100644 --- a/nvim/lua/lib/lazy/util.lua +++ b/nvim/lua/lib/lazy/util.lua @@ -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 local M = {} ---@return string function M.norm(path) - if path:sub(1, 1) == "~" then - local home = vim.uv.os_homedir() or "" + if path:sub(1, 1) == '~' then + 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) end path = home .. path:sub(2) 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 + +return M