fix(picker.input): don't set prompt interrupt, but use a <c-c> mapping instead that can be changed

This commit is contained in:
Folke Lemaitre 2025-01-16 12:56:28 +01:00
parent 0745505f2f
commit 123f0d9e5d
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
2 changed files with 1 additions and 3 deletions

View file

@ -121,6 +121,7 @@ local defaults = {
input = {
keys = {
["<Esc>"] = "close",
["<C-c>"] = { "close", mode = "i" },
-- to close the picker on ESC instead of going to normal mode,
-- add the following keymap to your config
-- ["<Esc>"] = { "close", mode = { "n", "i" } },

View file

@ -32,9 +32,6 @@ function M.new(picker)
vim.fn.prompt_setcallback(self.win.buf, function()
self.win:execute("confirm")
end)
vim.fn.prompt_setinterrupt(self.win.buf, function()
self.win:close()
end)
end,
bo = {
filetype = "snacks_picker_input",