fix(picker): resume. Closes #709

This commit is contained in:
Folke Lemaitre 2025-01-23 07:49:55 +01:00
parent 2568f18c4d
commit 9b55a907bd
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
2 changed files with 4 additions and 1 deletions

View file

@ -331,6 +331,7 @@ function M.resume()
last.opts.pattern = last.filter.pattern
last.opts.search = last.filter.search
local ret = M.new(last.opts)
ret:show()
ret.list:set_selected(last.selected)
ret.list:update()
ret.input:update()
@ -478,6 +479,8 @@ function M:close()
M.last.selected = self:selected({ fallback = false })
M.last.cursor = self.list.cursor
M.last.topline = self.list.top
M.last.opts = M.last.opts or {}
M.last.opts.live = self.opts.live
Snacks.picker.current = nil
local current = vim.api.nvim_get_current_win()
local is_picker_win = vim.tbl_contains({ self.input.win.win, self.list.win.win, self.preview.win.win }, current)

View file

@ -110,7 +110,7 @@ function M.grep(opts, ctx)
return require("snacks.picker.source.proc").proc({
opts,
{
notify = not opts.live,
notify = false, -- never notify on grep errors, since it's impossible to know if the error is due to the search pattern
cmd = cmd,
args = args,
---@param item snacks.picker.finder.Item