-
Did you check docs and existing issues?
Neovim version (nvim -v)NVIM v0.10.2 Operating system/versionArch 5.15.167.4-microsoft-standard-WSL2 Describe the bugWhen using the files picker on a parent directory of the current directory. The current directory shows as a blank item. Steps To ReproduceHere's the function that's causing the issue. Run the function then press function example_func()
local cwd = vim.loop.cwd()
local sp = require('snacks.picker')
sp.files({
cmd = 'fd',
args = { '--color=never', '--hidden', '--follow', '--exclude', '.git', '--max-depth', '1' },
actions = {
parent = {
action = function(picker, selected)
cwd = vim.loop.fs_realpath(cwd .. '/..')
picker:set_cwd(cwd)
picker:find()
end,
},
},
win = {
input = {
keys = {
['<c-w>'] = { 'parent', mode = { 'i', 'n' } },
},
},
},
})
end I've tried printing in the Expected BehaviorThe directory should be shown like any other. Reprovim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()
require("lazy.minit").repro({
spec = {
{ "folke/snacks.nvim", opts = {} },
-- add any other plugins here
},
}) |
Beta Was this translation helpful? Give feedback.
Answered by
WolfeCub
Jan 26, 2025
Replies: 1 comment 8 replies
-
This works fine for me: local cwd = vim.loop.cwd()
Snacks.picker.files({
actions = {
parent = {
action = function(picker, selected)
cwd = vim.loop.fs_realpath(cwd .. "/..")
picker:set_cwd(cwd)
picker:find()
end,
},
},
win = {
input = {
keys = {
["<c-w>"] = { "parent", mode = { "i", "n" } },
},
},
},
})
`` |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Something changed in one of the recent updates. I was overriding the
args
previously and something changed in how that works since I used to be getting directories back.Regardless I managed to get it working: