From 216ba4a8b2b751e2e86da6f7d8fe59b1a67c1197 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=A6=E8=8B=87?= <1280380446@qq.com> Date: Thu, 16 Oct 2025 03:18:52 +0800 Subject: [PATCH] fix: should not add 'add current keymap' if auto_set_keymaps is false (#2773) --- lua/avante/sidebar.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/avante/sidebar.lua b/lua/avante/sidebar.lua index a595ded..f3bdf1c 100644 --- a/lua/avante/sidebar.lua +++ b/lua/avante/sidebar.lua @@ -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" })