fix: can view drives on Windows

This commit is contained in:
Steven Arcangeli 2023-11-05 07:27:28 -08:00
parent 7ea4dda1a5
commit 126a8a2346
4 changed files with 92 additions and 43 deletions

View file

@ -83,7 +83,8 @@ end
M.posix_to_os_path = function(path)
if M.is_windows then
if vim.startswith(path, "/") then
local drive, rem = path:match("^/([^/]+)/(.*)$")
local drive = path:match("^/(%a+)")
local rem = path:sub(drive:len() + 2)
return string.format("%s:\\%s", drive, rem:gsub("/", "\\"))
else
local newpath = path:gsub("/", "\\")