-
-
Notifications
You must be signed in to change notification settings - Fork 155
Open
Description
Description
When I open the chat window with a sticky prompt specified in the config I pass in, those sticky messages are not shown in the chat window. This appears to be related to 1ff0bb3
Reproducer
:lua require("CopilotChat").open({ sticky = { "@copilot", "A custom sticky message" } })
Current Behavior
Expected Behavior
Config
local chat = {
"CopilotC-Nvim/CopilotChat.nvim",
branch = "main",
dependencies = {
{ "zbirenbaum/copilot.lua" },
{ "nvim-lua/plenary.nvim" },
},
build = "make tiktoken",
opts = {
debug = false,
model = "claude-sonnet-4", -- default model
auto_insert_mode = false, -- Automatically enter insert mode when opening window and on new prompt
insert_at_end = false, -- Move cursor to end of buffer when inserting text
remember_as_sticky = true,
diff = "block", -- default to markdown diff blocks
sticky = { "@copilot" }, -- automatically use copilot tools in every sesssion
-- open window in right 1/3rd of window
window = {
layout = "vertical",
width = 0.3,
title = " Copilot Chat",
},
headers = {
user = " User",
assistant = " Assistant",
tool = " Tool",
},
-- Use render-markdown for nicer rendering
highlight_headers = true,
separator = "---",
error_header = "> [!ERROR] Error",
-- custom prompts
prompts = {
PythonExpert = {
system_prompt = "You are an expert Python developer with knowledge of language best practices, helping an experienced software engineer in their day to day work",
},
},
-- custom mappings within copilot chat buffer
mappings = {
submit_prompt = {
normal = "<CR>",
insert = "<C-y>",
},
accept_diff = {
normal = "<C-s>",
insert = "<C-s>",
},
-- make it hard to accidentally reset the chat
reset = {
normal = "ggr",
insert = "<C-r><C-y>",
},
},
},
keys = {
{
"<Leader>co",
function()
local config = {}
if vim.bo.filetype == "python" then config.sticky = {"@copilot", "/PythonExpert"} end
require("CopilotChat").open(config) end,
mode = { "n", "v" },
},
},
cmd = {
"CopilotChat",
"CopilotChatOpen",
"CopilotChatToggle",
"CopilotChatExplain",
"CopilotChatReview",
"CopilotChatFix",
"CopilotChatOptimize",
"CopilotChatDocs",
"CopilotChatTests",
"CopilotChatFixDiagnostic",
"CopilotChatCommit",
"CopilotChatCommitStaged",
"CopilotChatModels",
"CopilotChatLoad",
},
init = function()
vim.api.nvim_create_autocmd("BufEnter", {
pattern = "copilot-*",
callback = function()
vim.opt_local.relativenumber = false
vim.opt_local.number = false
end,
})
end,
}Metadata
Metadata
Assignees
Labels
No labels