We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6632469 commit 4f71c0cCopy full SHA for 4f71c0c
1 file changed
lua/plenary/path.lua
@@ -696,7 +696,11 @@ end
696
local _get_parent = (function()
697
local formatted = string.format("^(.+)%s[^%s]+", path.sep, path.sep)
698
return function(abs_path)
699
- return abs_path:match(formatted)
+ local parent = abs_path:match(formatted)
700
+ if parent ~= nil and not parent:find(path.sep) then
701
+ return parent .. path.sep
702
+ end
703
+ return parent
704
end
705
end)()
706
0 commit comments