mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 10:49:08 +00:00
fix(picker.preview): hide line numbers / status column for directory preview. Closes #1029
This commit is contained in:
parent
a386e4270b
commit
f9aca86bf3
2 changed files with 9 additions and 1 deletions
|
@ -7,6 +7,10 @@ local ns = vim.api.nvim_create_namespace("snacks.picker.preview")
|
|||
---@param ctx snacks.picker.preview.ctx
|
||||
function M.directory(ctx)
|
||||
ctx.preview:reset()
|
||||
ctx.preview:minimal()
|
||||
local path = Snacks.picker.util.path(ctx.item)
|
||||
local name = path and vim.fn.fnamemodify(path, ":t")
|
||||
ctx.preview:set_title(ctx.item.title or name)
|
||||
local ls = {} ---@type {file:string, type:"file"|"directory"}[]
|
||||
for file, t in vim.fs.dir(ctx.item.file) do
|
||||
ls[#ls + 1] = { file = file, type = t }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue