Update lua/lazyvim/util/root.lua

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
ian 2026-03-26 08:42:15 +08:00 committed by GitHub
parent a78c5286e6
commit 648ff3849b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -69,7 +69,7 @@ end
function M.bufpath(buf)
local name = LazyVim.norm(vim.api.nvim_buf_get_name(assert(buf)))
local path = name and name:match("^term:/(.+/%d+):") or name
-- fix duplicated driver letters for Windows
-- fix duplicated drive letters for Windows
if vim.fn.has("win32") == 1 and path and path:find(":/.*:/") then
path = path:gsub("^.-%:/", "", 1)
end