From 0d5db08015d41a0e3da727bf70796f3a4abcfa76 Mon Sep 17 00:00:00 2001 From: Steven Arcangeli Date: Sat, 18 Mar 2023 00:07:38 -0700 Subject: [PATCH] fix: always enter directory entries as a directory --- lua/oil/init.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/oil/init.lua b/lua/oil/init.lua index 50cc52d..22d8547 100644 --- a/lua/oil/init.lua +++ b/lua/oil/init.lua @@ -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.