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
Which means the ipairs iteration won't see any of the results after the nil.
Having the entry_maker return {} instead isn't ideal because then the results count is off (i.e. the empty rows aren't displayed but they still show up in the count of results).
I think the correct behavior is for Picker:delete_selection to use pairs instead.
==============================================================================
telescope: require("telescope.health").check()
Checking for required plugins ~
- OK plenary installed.
- OK nvim-treesitter installed.
Checking external dependencies ~
- OK rg: found ripgrep 14.1.0
- OK fd: found fd 10.1.0
===== Installed extensions ===== ~
Telescope Extension: `advanced_git_search` ~
- No healthcheck provided
Telescope Extension: `fzf` ~
- OK lib working as expected
- OK file_sorter correctly configured
- OK generic_sorter correctly configured
Telescope Extension: `neoclip` ~
- No healthcheck provided
Telescope Extension: `session-lens` ~
- No healthcheck provided
Telescope Extension: `ui-select` ~
- No healthcheck provided
Steps to reproduce
Use minimal config
Run touch .repro/data/nvim/sessions/ax.vim to create an empty session file (do this in the directory used for the repro). This will cause the entry_maker to return nil for this file
run nvim -u repro.lua
Save a session via :SessionSave
Open session picker via :SessionSearch
Try to delete the session you just created (the only one in the picker) with
Expected behavior
The session is deleted and the picker is updated
Actual behavior
Nothing happens because Picker:delete_selection doesn't find the result so it doesn't call the callback to perform the delete
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 ISSUErequire("telescope").setup({})
end,
},
{
"rmagatti/auto-session",
lazy=false,
opts= {},
},
}
require("lazy").setup(plugins, {
root=root.."/plugins",
})
The text was updated successfully, but these errors were encountered:
Sometimes deleting a session from the the Telescope picker wasn't
working. It happens when we have extra command files that are filtered
out from the list. Those files break some code in Telescope that finds
the item we want to delete in the picker results. More detail is here:
nvim-telescope/telescope.nvim#3265
We work around the issue by having the Telescope entry maker returning
{} instead of nil. That's not perfect but better than not being able to
delete/
Telescope merged my fix for:
nvim-telescope/telescope.nvim#3265
So now we can return nil to have a correct count and still have delete
sessions from the Telescope picker work
Description
Picker:delete_selection
usesipairs
to iterate over thefinder.results
:telescope.nvim/lua/telescope/pickers.lua
Lines 836 to 840 in 5972437
If the
entry_maker
for a one shot job returns nil for one of the lines, it makes the indices discontinuous:telescope.nvim/lua/telescope/finders/async_oneshot_finder.lua
Lines 66 to 79 in 5972437
Which means the
ipairs
iteration won't see any of the results after the nil.Having the
entry_maker
return{}
instead isn't ideal because then the results count is off (i.e. the empty rows aren't displayed but they still show up in the count of results).I think the correct behavior is for
Picker:delete_selection
to usepairs
instead.Neovim version
Operating system and version
macos 14.6
Telescope version / branch / rev
telescope 0.1.8
checkhealth telescope
Steps to reproduce
touch .repro/data/nvim/sessions/ax.vim
to create an empty session file (do this in the directory used for the repro). This will cause the entry_maker to returnnil
for this filenvim -u repro.lua
:SessionSave
:SessionSearch
Expected behavior
The session is deleted and the picker is updated
Actual behavior
Nothing happens because
Picker:delete_selection
doesn't find the result so it doesn't call the callback to perform the deleteMinimal config
The text was updated successfully, but these errors were encountered: