From 32d5ea8e425a826e23c5ccc28ef612922b08f714 Mon Sep 17 00:00:00 2001 From: Will Norris Date: Thu, 26 Sep 2024 11:37:04 -0700 Subject: [PATCH] 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. --- lua/lazyvim/util/lualine.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/util/lualine.lua b/lua/lazyvim/util/lualine.lua index 6284504a..98f1b644 100644 --- a/lua/lazyvim/util/lualine.lua +++ b/lua/lazyvim/util/lualine.lua @@ -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