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

@ -1,16 +1,8 @@
local fs = require("oil.fs")
local M = {}
---@param path string
---@return string
M.parent = function(path)
-- Do I love this hack? No I do not.
-- Does it work? Yes. Mostly. For now.
if fs.is_windows then
if path:match("^/%a+/?$") then
return path
end
end
if path == "/" then
return "/"
elseif path == "" then