You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pickers that utilize async_oneshot_finder populate the results table, while those using async_job_finder do not. This behavior difference causes issues when relying on results for certain picker operations. Below is the code responsible for finders that populate the results table:
For example, the live_grep picker uses async_job_finder, resulting in self.finder.results being nil. Consequently, operations like the delete_selection function fail with such pickers because it relies on self.finder.results, as seen in the following code:
telescope: health#telescope#check
Checking for required plugins ~
- OK plenary installed.
- OK nvim-treesitter installed.
Checking external dependencies ~
- OK rg: found ripgrep 14.1.1
- WARNING fd: not found. Install [sharkdp/fd](https://github.com/sharkdp/fd) for extended capabilities
===== Installed extensions ===== ~
Telescope Extension: `fzf` ~
- OK lib working as expected
- OK file_sorter correctly configured
- OK generic_sorter correctly configured
Steps to reproduce
Open find_files, make a meaningful search then press <C-r>
Open live_grep, make a meaningful search then press <C-r>
Expected behavior
The function should automatically remove the entry from the search results in both cases (live_grep and find_files)
Actual behavior
find_files search results gets removed on using <C-r>, however when performing same operation on live_grep, the following error is encountered
E5108: Error executing lua: .../.repro/plugins/telescope.nvim/lua/telescope/pic
kers.lua:831: bad argument #1 to 'pairs' (table expected, got nil)
stack traceback:
[C]: in function 'pairs'
.../.repro/plugins/telescope.nvim/lua/telescope/pickers.lua:831: in function 'delete_selection'
/home/USER/.config/nvim/minimal.lua:37: in function 'key_func'
....repro/plugins/telescope.nvim/lua/telescope/mappings.lua:293: in function <....repro/plugins/telescope.nvim/lua/telescope/mappings.lua:292>
Minimal config
localroot=vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .reprofor_, nameinipairs { "config", "data", "state", "cache" } dovim.env[("XDG_%s_HOME"):format(name:upper())] =root.."/" ..nameend-- bootstrap lazylocallazypath=root.."/plugins/lazy.nvim"ifnotvim.uv.fs_stat(lazypath) thenvim.fn.system {
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
lazypath,
}
endvim.opt.runtimepath:prepend(lazypath)
-- install pluginslocalplugins= {
{
"nvim-telescope/telescope.nvim",
dependencies= {
"nvim-lua/plenary.nvim",
},
config=function()
-- ADD INIT.LUA SETTINGS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUElocalaction_state=require("telescope.actions.state")
require("telescope").setup {
defaults= {
mappings= {
i= {
["<C-r>"] =function(prompt_bufnr)
localcurrent_picker=action_state.get_current_picker(prompt_bufnr)
current_picker:delete_selection(function() returntrueend)
end
},
},
}
}
end,
},
}
require("lazy").setup(plugins, {
root=root.."/plugins",
})
The text was updated successfully, but these errors were encountered:
Description
Pickers that utilize
async_oneshot_finder
populate theresults
table, while those usingasync_job_finder
do not. This behavior difference causes issues when relying onresults
for certain picker operations. Below is the code responsible for finders that populate theresults
table:telescope.nvim/lua/telescope/finders/async_oneshot_finder.lua
Line 77 in 2eca9ba
For example, the
live_grep
picker usesasync_job_finder
, resulting inself.finder.results
beingnil
. Consequently, operations like thedelete_selection
function fail with such pickers because it relies onself.finder.results
, as seen in the following code:telescope.nvim/lua/telescope/pickers.lua
Line 831 in 2eca9ba
Neovim version
Operating system and version
Debian 13
Telescope version / branch / rev
telescope 0.1.8
checkhealth telescope
Steps to reproduce
find_files
, make a meaningful search then press<C-r>
live_grep
, make a meaningful search then press<C-r>
Expected behavior
The function should automatically remove the entry from the search results in both cases (
live_grep
andfind_files
)Actual behavior
find_files
search results gets removed on using<C-r>
, however when performing same operation onlive_grep
, the following error is encounteredMinimal config
The text was updated successfully, but these errors were encountered: