mirror of
https://github.com/zoriya/telescope.nvim.git
synced 2026-08-16 02:45:09 +00:00
fix(builtin.pickers): fix wrong picker resuming when using filtering (#2682)
When filtering is applied, `picker:get_index(picker:get_selection_row())` returns index relative to the filtered entry list rather than the original full results. This causes inaccurate indexing into the `cache_pickers` table.
(cherry picked from commit 74be3c3bba)
This commit is contained in:
committed by
Simon Hauser
parent
d3105f70dd
commit
0847120c40
@@ -555,4 +555,30 @@ utils.__warn_no_selection = function(name)
|
||||
})
|
||||
end
|
||||
|
||||
--- Generate git command optionally with git env variables
|
||||
---@param args string[]
|
||||
---@param opts? table
|
||||
---@return string[]
|
||||
utils.__git_command = function(args, opts)
|
||||
opts = opts or {}
|
||||
|
||||
local _args = { "git" }
|
||||
if opts.gitdir then
|
||||
vim.list_extend(_args, { "--git-dir", opts.gitdir })
|
||||
end
|
||||
if opts.toplevel then
|
||||
vim.list_extend(_args, { "--work-tree", opts.toplevel })
|
||||
end
|
||||
|
||||
return vim.list_extend(_args, args)
|
||||
end
|
||||
|
||||
utils.list_find = function(func, list)
|
||||
for i, v in ipairs(list) do
|
||||
if func(v, i, list) then
|
||||
return i, v
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return utils
|
||||
|
||||
Reference in New Issue
Block a user