Skip to content

Commit

Permalink
fix(path): Windows parent root directory (nvim-lua#504)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamestrew authored Jan 29, 2024
1 parent 6632469 commit 4f71c0c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lua/plenary/path.lua
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,11 @@ end
local _get_parent = (function()
local formatted = string.format("^(.+)%s[^%s]+", path.sep, path.sep)
return function(abs_path)
return abs_path:match(formatted)
local parent = abs_path:match(formatted)
if parent ~= nil and not parent:find(path.sep) then
return parent .. path.sep
end
return parent
end
end)()

Expand Down

0 comments on commit 4f71c0c

Please sign in to comment.