Skip to content

Commit

Permalink
Null-check model choice after :CopilotChatModel
Browse files Browse the repository at this point in the history
If you dont select anything and just ESC it sets the model to nil atm.

Signed-off-by: Tomas Slusny <[email protected]>
  • Loading branch information
deathbeam committed Sep 25, 2024
1 parent 1acb735 commit 9333944
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/CopilotChat/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,9 @@ function M.select_model()
vim.ui.select(models, {
prompt = 'Select a model',
}, function(choice)
M.config.model = choice
if choice then
M.config.model = choice
end
end)
end)
end)
Expand Down

0 comments on commit 9333944

Please sign in to comment.