fix(lualine): only trim root from path if present

Ensure that path actually begins with root before trimming it off the
front. Otherwise, the path gets mangled.
This commit is contained in:
Will Norris 2024-09-26 11:37:04 -07:00
parent a1c3ec4cd4
commit 32d5ea8e42

View file

@ -96,7 +96,7 @@ function M.pretty_path(opts)
if opts.relative == "cwd" and path:find(cwd, 1, true) == 1 then
path = path:sub(#cwd + 2)
else
elseif path:find(root, 1, true) == 1 then
path = path:sub(#root + 2)
end