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