fix: always enter directory entries as a directory

This commit is contained in:
Steven Arcangeli 2023-03-18 00:07:38 -07:00
parent 9814c8b3f1
commit 0d5db08015

View file

@ -394,15 +394,15 @@ M.select = function(opts)
local scheme, dir = util.parse_url(bufname)
local child = dir .. entry.name
local url = scheme .. child
if
entry.type == "directory"
local is_directory = entry.type == "directory"
or (
entry.type == "link"
and entry.meta
and entry.meta.link_stat
and entry.meta.link_stat.type == "directory"
)
then
if is_directory then
url = url .. "/"
-- If this is a new directory BUT we think we already have an entry with this name, disallow
-- entry. This prevents the case of MOVE /foo -> /bar + CREATE /foo.
-- If you enter the new /foo, it will show the contents of the old /foo.