feat(sidebar): move quit and close key mappings into config values. (#979)

This commit is contained in:
Christopher Brewin 2025-02-02 00:48:11 +10:00 committed by GitHub
parent 692c168e5b
commit 0a273c2f5d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 6 deletions

View File

@ -197,6 +197,7 @@ M._defaults = {
reverse_switch_windows = "<S-Tab>",
remove_file = "d",
add_file = "@",
close = { "<Esc>", "q" },
},
files = {
add_current = "<leader>ac", -- Add current buffer to selected files

View File

@ -2138,12 +2138,7 @@ function Sidebar:render(opts)
xpcall(function() api.nvim_buf_set_name(self.result_container.bufnr, RESULT_BUF_NAME) end, function(_) end)
end)
self.result_container:map("n", "q", function()
Llm.cancel_inflight_request()
self:close()
end)
self.result_container:map("n", "<Esc>", function()
self.result_container:map("n", Config.mappings.sidebar.close, function()
Llm.cancel_inflight_request()
self:close()
end)