zbirenbaum / copilot.lua

Fully featured & enhanced replacement for copilot.vim complete with API for interacting with Github Copilot
MIT License
2.43k stars 65 forks source link

Need to escape twice when virtual text is shown #203

Closed lcrownover closed 10 months ago

lcrownover commented 10 months ago

First off, thank you for providing copilot functionality via lua!

I'm not actually certain this is an issue specifically with this plugin, but I've only experienced the behavior using it.

When I'm in insert mode and virtual text is shown, pressing Escape clears the virtual text, but does not return me to Normal mode. I have to press escape twice.

Here's my config for copilot.lua:

require("copilot").setup({ 
    suggestion = {
        auto_trigger = true,
        keymap = {
            accept = "<C-]>",
            dismiss = "<C-[>",
        },
    },
    filetypes = {
        yaml = true,
    },
})

Looking through keymaps doesn't have anything bound to Escape or anything that might be eating the first keypress.

Any ideas would be super helpful, thanks!

MunifTanjim commented 10 months ago

<C-[> is Escape. Check :help c_Esc

lcrownover commented 10 months ago

Nice! I figured it was something I was doing wrong. Thank you for pointing that out!