From 42333bb46e34dd47e13927010b1dcd30e6e4ca96 Mon Sep 17 00:00:00 2001 From: Foo-x Date: Tue, 29 Oct 2024 02:55:25 +0900 Subject: [PATCH] fix: add trailing slash to directories on yank_entry (#504) * feat: add trailing slash on yank_entry Closes #503 * style: format --- lua/oil/actions.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/oil/actions.lua b/lua/oil/actions.lua index b097e680..50a266ab 100644 --- a/lua/oil/actions.lua +++ b/lua/oil/actions.lua @@ -366,7 +366,11 @@ M.yank_entry = { if not entry or not dir then return end - local path = dir .. entry.name + local name = entry.name + if entry.type == "directory" then + name = name .. "/" + end + local path = dir .. name if opts.modify then path = vim.fn.fnamemodify(path, opts.modify) end