Skip to content

Commit

Permalink
feat: directories sent to the qf list end in '/'
Browse files Browse the repository at this point in the history
This makes it a bit easier to distinguish between files and directories
  • Loading branch information
mikavilpas committed May 5, 2024
1 parent 06ace92 commit 85dafe2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lua/yazi/openers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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),
})
Expand Down

0 comments on commit 85dafe2

Please sign in to comment.