Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lua/snacks/picker/actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,11 @@ function M.cycle_win(picker)
end
end
win = wins[idx % #wins + 1] or 1 -- cycle
for name, layout in pairs(picker.layout.wins) do
if layout.win == win then
picker.init_opts.focus = name
end
end
vim.api.nvim_set_current_win(win)
end

Expand Down
1 change: 1 addition & 0 deletions lua/snacks/picker/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ M.meta = {
---@field source? string
---@field include? string[]
---@field exclude? string[]
---@field focus? "input"|"list"

-- create actual picker functions for autocomplete
vim.defer_fn(function()
Expand Down
3 changes: 3 additions & 0 deletions lua/snacks/picker/resume.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ function M.resume(opts)

for _, source in ipairs(sources) do
if M.state[source] and not vim.tbl_contains(opts.exclude or {}, source) then
if opts.focus then
M.state[source].opts.focus = opts.focus
end
states[#states + 1] = M.state[source]
end
end
Expand Down