diff --git a/lua/codesettings/util.lua b/lua/codesettings/util.lua index ef9de70..c0bc3b3 100644 --- a/lua/codesettings/util.lua +++ b/lua/codesettings/util.lua @@ -43,7 +43,13 @@ function M.fqn(fname) end ---strip off trailing slash, if any +---@param path string? local function normalize_root(path) + -- if nil then return nil + if not path then + return path + end + if vim.endswith(path, '/') and path ~= '/' then return path:sub(1, -2) end