CopilotC-Nvim / CopilotC-Nvim/CopilotChat.nvim
Accepting change in diff view and/or adding highlighting groups for diff
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 3.7k
- Forks
- 171
- Avg merge
- 16h 26m
- Merged PRs (30d)
- 1
Description
When asking to create a change, copilot will generate text (sometimes long), but the visual indication of what that change will be is difficult to assess other than reading the code. Moving to closest diff does move my cursor there, but it doesn't clearly indicate what the change will be. Viewing the show_diff window does clearly show what would be changed with this particular change, but from here accepting appears impossible.
It would be nice if it was;
- Possible to accept the change after viewing it in the show_diff view
- If the change itself could more clearly indicate/highlight (both in the copilot chat window) as in the text. Possibly by giving it a treesitter/LSP designation that would then allow for a highlight group.
See for example the following picture:
The change entails the uncommenting of two lines of code. The moving to closest diff identifies the code block that change would be affecting, however the actual diff isn't highlighted, neither in the original buffer, nor in the chat window.
The show_diff does properly show it but the accept change isn't working while viewing it in this manner:
Assuming I didn't frack up a setting or miss some particular config, I think it would be great if there was clearer indication of the overall changes that would be applied.
-Dagl
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 by tracing the show_diff view, the accept-change action, and the closest-diff navigation used by the Copilot chat window. Reproduce the uncommented-lines example and compare the original buffer, chat window, and show_diff behavior. Done means a viewed diff can be accepted and the proposed changes are visibly highlighted in the relevant views.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua, neovim
- Domain
- developer-experience, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100