Skip to content
Merged
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
8 changes: 5 additions & 3 deletions lua/parrot/chat_handler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1070,7 +1070,7 @@ function ChatHandler:provider(params)
results = self.available_providers,
}),
sorter = sorters.values.generic_sorter({}),
attach_mappings = function(prompt_bufnr, map)
attach_mappings = function(_, map)
local on_select = function(prompt_bufnr)
local selection = action_state.get_selected_entry(prompt_bufnr)
actions.close(prompt_bufnr)
Expand Down Expand Up @@ -1154,7 +1154,7 @@ function ChatHandler:model(params)
}),
sorter = sorters.values.generic_sorter({}),
attach_mappings = function(_, map)
map("i", "<CR>", function(prompt_bufnr)
local on_select = function(prompt_bufnr)
local selected_entry = action_state.get_selected_entry()
actions.close(prompt_bufnr)
if not selected_entry then
Expand All @@ -1163,7 +1163,9 @@ function ChatHandler:model(params)
end
local selected_model = selected_entry[1]
self:switch_model(is_chat, selected_model, prov)
end)
end
map("i", "<CR>", on_select)
map("n", "<CR>", on_select)

return true
end,
Expand Down