Skip to content

Commit 9ea6718

Browse files
committed
Fix loading of default context
Accidentally forgot to load it after reworking how contexts work Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
1 parent ec7c246 commit 9ea6718

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

lua/CopilotChat/init.lua

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ function M.ask(prompt, config)
531531
or 'untitled'
532532

533533
local embeddings = {}
534-
for prompt_context in prompt:gmatch('#([^%s]+)') do
534+
local function parse_context(prompt_context)
535535
local split = vim.split(prompt_context, ':')
536536
local context_name = split[1]
537537
local context_input = split[2]
@@ -548,6 +548,14 @@ function M.ask(prompt, config)
548548
end
549549
end
550550

551+
if config.context then
552+
parse_context(config.context)
553+
end
554+
555+
for prompt_context in prompt:gmatch('#([^%s]+)') do
556+
parse_context(prompt_context)
557+
end
558+
551559
async.run(function()
552560
local agents = vim.tbl_keys(state.copilot:list_agents())
553561
local selected_agent = config.agent

0 commit comments

Comments
 (0)