Skip to content

Commit

Permalink
Fix loading of default context
Browse files Browse the repository at this point in the history
Accidentally forgot to load it after reworking how contexts work

Signed-off-by: Tomas Slusny <[email protected]>
  • Loading branch information
deathbeam committed Nov 17, 2024
1 parent ec7c246 commit 9ea6718
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lua/CopilotChat/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ function M.ask(prompt, config)
or 'untitled'

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

if config.context then
parse_context(config.context)
end

for prompt_context in prompt:gmatch('#([^%s]+)') do
parse_context(prompt_context)
end

async.run(function()
local agents = vim.tbl_keys(state.copilot:list_agents())
local selected_agent = config.agent
Expand Down

0 comments on commit 9ea6718

Please sign in to comment.