fix: can view drives on Windows
This commit is contained in:
parent
7ea4dda1a5
commit
126a8a2346
4 changed files with 92 additions and 43 deletions
|
|
@ -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("/", "\\")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue