mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-03 18:28:38 +00:00
fix(explorer): always use --follow
to make sure we see dir symlinks as dirs. Fixes #814
This commit is contained in:
parent
0e4ddfd3ee
commit
151fd3d62d
2 changed files with 10 additions and 3 deletions
|
@ -32,11 +32,11 @@ function M.setup(event)
|
|||
local function handle(ev)
|
||||
if ev.file ~= "" and vim.fn.isdirectory(ev.file) == 1 then
|
||||
local picker = M.open({ cwd = ev.file })
|
||||
local ref = picker:ref()
|
||||
if vim.v.vim_did_enter == 0 then
|
||||
if picker and vim.v.vim_did_enter == 0 then
|
||||
-- clear bufname so we don't try loading this one again
|
||||
vim.api.nvim_buf_set_name(ev.buf, "")
|
||||
picker:show()
|
||||
local ref = picker:ref()
|
||||
-- focus on UIEnter, since focusing before doesn't work
|
||||
vim.api.nvim_create_autocmd("UIEnter", {
|
||||
once = true,
|
||||
|
|
|
@ -184,7 +184,14 @@ function State:setup(opts, ctx)
|
|||
opts = Snacks.picker.util.shallow_copy(opts)
|
||||
opts.cmd = "fd"
|
||||
opts.cwd = self.cwd
|
||||
opts.args = { "--type", "d", "--path-separator", "/", "--absolute-path" }
|
||||
opts.args = {
|
||||
"--type",
|
||||
"d", -- include directories
|
||||
"--path-separator", -- same everywhere
|
||||
"/",
|
||||
"--absolute-path", -- easier to work with
|
||||
"--follow", -- always needed to make sure we see symlinked dirs as dirs
|
||||
}
|
||||
self.all = #ctx.filter.search > 0
|
||||
if self.all then
|
||||
local picker = self.picker()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue