Skip to content

Commit acfec2b

Browse files
authored
Merge pull request #147 from dqnk/main
fix: model selection with telescope in normal mode
2 parents aa2d96e + 7dbf314 commit acfec2b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lua/parrot/chat_handler.lua

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,7 +1070,7 @@ function ChatHandler:provider(params)
10701070
results = self.available_providers,
10711071
}),
10721072
sorter = sorters.values.generic_sorter({}),
1073-
attach_mappings = function(prompt_bufnr, map)
1073+
attach_mappings = function(_, map)
10741074
local on_select = function(prompt_bufnr)
10751075
local selection = action_state.get_selected_entry(prompt_bufnr)
10761076
actions.close(prompt_bufnr)
@@ -1154,7 +1154,7 @@ function ChatHandler:model(params)
11541154
}),
11551155
sorter = sorters.values.generic_sorter({}),
11561156
attach_mappings = function(_, map)
1157-
map("i", "<CR>", function(prompt_bufnr)
1157+
local on_select = function(prompt_bufnr)
11581158
local selected_entry = action_state.get_selected_entry()
11591159
actions.close(prompt_bufnr)
11601160
if not selected_entry then
@@ -1163,7 +1163,9 @@ function ChatHandler:model(params)
11631163
end
11641164
local selected_model = selected_entry[1]
11651165
self:switch_model(is_chat, selected_model, prov)
1166-
end)
1166+
end
1167+
map("i", "<CR>", on_select)
1168+
map("n", "<CR>", on_select)
11671169

11681170
return true
11691171
end,

0 commit comments

Comments
 (0)