Skip to content

Commit 42333bb

Browse files
authored
fix: add trailing slash to directories on yank_entry (#504)
* feat: add trailing slash on yank_entry Closes #503 * style: format
1 parent cca1631 commit 42333bb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lua/oil/actions.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,11 @@ M.yank_entry = {
366366
if not entry or not dir then
367367
return
368368
end
369-
local path = dir .. entry.name
369+
local name = entry.name
370+
if entry.type == "directory" then
371+
name = name .. "/"
372+
end
373+
local path = dir .. name
370374
if opts.modify then
371375
path = vim.fn.fnamemodify(path, opts.modify)
372376
end

0 commit comments

Comments
 (0)