fix: should not add 'add current keymap' if auto_set_keymaps is false (#2773)

This commit is contained in:
芦苇
2025-10-16 03:18:52 +08:00
committed by GitHub
parent 4a68e29165
commit 216ba4a8b2

View File

@@ -1312,7 +1312,7 @@ function Sidebar:on_mount(opts)
self:setup_window_navigation(self.containers.result)
-- Add keymap to add current buffer while sidebar is open
if Config.mappings.files and Config.mappings.files.add_current then
if Config.behaviour.auto_set_keymaps and Config.mappings.files and Config.mappings.files.add_current then
vim.keymap.set("n", Config.mappings.files.add_current, function()
if self:is_open() and self.file_selector:add_current_buffer() then
vim.notify("Added current buffer to file selector", vim.log.levels.DEBUG, { title = "Avante" })