-
Notifications
You must be signed in to change notification settings - Fork 205
Closed as not planned
Labels
Description
Did you check docs and existing issues?
- I have read all the trouble.nvim docs
- I have updated the plugin to the latest version before submitting this issue
- I have searched the existing issues of trouble.nvim
- I have searched the existing issues of plugins related to this issue
Neovim version (nvim -v)
NVIM v0.10.4
Operating system/version
Arch Linux
Describe the bug
when searching files with snacks files picker with other cwd
Snacks.picker.files({ cwd = other_cwd })
then using 'trouble_open' action to show results in trouble window, it actually shows the results without considering the cwd parameter, it shows files in neovim's working directory
same thing is happening with Snacks.picker.grep
Steps To Reproduce
- mkdir -p mydir/mysubdir
- echo test > mydir/mysubdir/test.txt
- cd mydir && nvim
- :lua Snacks.picker.files({ cwd = vim.fn.getcwd() .. '/mysubdir' })
- use 'trouble_open' action to show the results in trouble window then try to open the file, it will open mydir/test.txt
- :lua vim.print(vim.fn.bufname())
Expected Behavior
Using 'trouble_open' action should show files with right paths
Repro
vim.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/trouble.nvim",
opts = {},
specs = {
"folke/snacks.nvim",
opts = function(_, opts)
return vim.tbl_deep_extend("force", opts or {}, {
picker = {
actions = require("trouble.sources.snacks").actions,
win = {
input = {
keys = {
["<c-q>"] = {
"trouble_open",
mode = { "n", "i" },
},
},
},
},
},
})
end,
},
},
{ "folke/snacks.nvim" },
},
})
andradei