Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix(snacks): update selection handling in snacks picker
Change the picker's selection handling from multiple to single item mode by
replacing selected() with current() method. This way, only the currently
highighted item is picked. Unfortunately, snacks.nvim's picker doesn't
support disabling multi-select, so this is a much better implementation.
  • Loading branch information
tku137 committed Jan 21, 2025
commit ce1ce5c17e71e90372d80dd09aaf237859a463db
6 changes: 3 additions & 3 deletions lua/CopilotChat/integrations/snacks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ function M.pick(pick_actions, opts)
preview = 'preview',
title = pick_actions.prompt,
confirm = function(picker)
local selected = picker:selected({ fallback = true })
if selected and #selected > 0 then
local action = pick_actions.actions[selected[1].id]
local selected = picker:current()
if selected then
local action = pick_actions.actions[selected.id]
vim.defer_fn(function()
chat.ask(action.prompt, action)
end, 100)
Expand Down