CopilotC-Nvim / CopilotChat.nvim

Chat with GitHub Copilot in Neovim
https://copilotc-nvim.github.io/CopilotChat.nvim/
GNU General Public License v3.0
1.44k stars 67 forks source link

Multiple code snippets #318

Open DRKolev-code opened 3 months ago

DRKolev-code commented 3 months ago

If we have a situation like this.


User ---

Can you give me python functin to sum two numbers. Also how to use it. Make it two different code blocks

Copilot ---

Sure, here is a Python function that sums two numbers:

def sum_two_numbers(a, b):
    return a + b

To use this function, you can call it with two numbers as arguments. Here is an example:

result = sum_two_numbers(3, 5)
print(result)  # Outputs: 8

Looking at diff gives us:

-/009   .config/
\ No newline at end of file
+result = sum_two_numbers(3, 5)
+print(result)  # Outputs: 8
\ No newline at end of file

It does not do a diff on the first part.

Could we have the yank, diff, accept actions allow something like:

1<leader>y to yank the first code snippet? Same architecture for diff and accept?