Skip to content

Commit 8f97191

Browse files
committed
fix: typos and correct chat/command mode detection
1 parent 708fccf commit 8f97191

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

lua/parrot/config.lua

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,12 +248,12 @@ local defaults = {
248248
["ProofReader"] = "You are a professional proofreader looking for spell and grammar errors",
249249
["CodeFixer"] = [[
250250
You are a proficient programmer in the provided language. I want you to
251-
look for erros and bugs within the provided snippet. Simply assume that you
251+
look for errors and bugs within the provided snippet. Simply assume that you
252252
have access to the used libraries and packages, hence skip importing them.
253253
]],
254254
["CodeFixerContext"] = [[
255255
You are a proficient programmer in the provided language. I want you to
256-
look for erros and bugs within the provided snippet given the full file content
256+
look for errors and bugs within the provided snippet given the full file content
257257
258258
```{{filetype}}
259259
{{filecontent}}
@@ -459,8 +459,11 @@ M.add_default_commands = function(commands, hooks, options)
459459
return completions[cmd]
460460
end
461461
if cmd == "Model" then
462-
-- TODO: Should detect the respective mode --
463-
local current_provider = M.chat_handler.state:get_provider(true) -- Use chat provider by default
462+
-- Detect whether we're in chat mode or command mode
463+
local buf = vim.api.nvim_get_current_buf()
464+
local file_name = vim.api.nvim_buf_get_name(buf)
465+
local is_chat = utils.is_chat(buf, file_name, M.options.chat_dir)
466+
local current_provider = M.chat_handler.state:get_provider(is_chat)
464467
if current_provider and M.available_models[current_provider] then
465468
return M.available_models[current_provider]
466469
end

0 commit comments

Comments
 (0)