From 85dafe2167b2542caf380f889629d94636ca9ba2 Mon Sep 17 00:00:00 2001 From: Mika Vilpas Date: Sun, 5 May 2024 14:01:28 +0300 Subject: [PATCH] feat: directories sent to the qf list end in '/' This makes it a bit easier to distinguish between files and directories --- lua/yazi/openers.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lua/yazi/openers.lua b/lua/yazi/openers.lua index b9910cf1..323bd0cd 100644 --- a/lua/yazi/openers.lua +++ b/lua/yazi/openers.lua @@ -25,10 +25,16 @@ function M.send_files_to_quickfix_list(chosen_files) vim.fn.setqflist({}, 'r', { title = 'Yazi', items = vim.tbl_map(function(file) + -- append / to directories + local path = file + if vim.fn.isdirectory(file) == 1 then + path = file .. '/' + end + return { - filename = file, lnum = 1, - text = file, + filename = path, + text = path, } end, chosen_files), })