CopilotC-Nvim / CopilotC-Nvim/CopilotChat.nvim
Make `M.chat:focus()` optional
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 3.7k
- Forks
- 171
- Avg merge
- 16h 26m
- Merged PRs (30d)
- 1
Description
Hallo,
{
"<leader>ae",
function()
local copilot = require("CopilotChat")
copilot.ask("Explain code underneath")
end,
desc = "Explain code underneath (CopilotChat)",
mode = { "n", "v" },
},
Consider this snippet as example, everything works fine, my last wish is that I don't want to focus copilot-chat window and for cursor to stay where it was before.
I think relevant line is here, but I don't fully understand logic behind checks if we are indeed in copilot-chat window and if I create flag and optionally disable vim.api.nvim_set_current_win(self.winnr) visual selection stops working.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in lua/CopilotChat/ui/chat.lua around line 460 and trace the window-selection logic used by copilot.ask. Check how the proposed optional focus behavior interacts with visual selections, then verify that the cursor remains in its original window when focus is disabled while existing focus behavior still works.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100