From ed5057448c610b576f4ea578070e579e7f646258 Mon Sep 17 00:00:00 2001 From: Aaron Pham Date: Thu, 22 Aug 2024 12:48:20 -0400 Subject: [PATCH] feat: tab switching behaviour (#155) * feat: tab switching behaviour Signed-off-by: Aaron Pham * revert: features Signed-off-by: Aaron Pham --------- Signed-off-by: Aaron Pham --- lua/avante/config.lua | 2 ++ lua/avante/sidebar.lua | 3 +++ 2 files changed, 5 insertions(+) diff --git a/lua/avante/config.lua b/lua/avante/config.lua index 5650471..2ed7d2e 100644 --- a/lua/avante/config.lua +++ b/lua/avante/config.lua @@ -75,7 +75,9 @@ M.defaults = { ---Specify the behaviour of avante.nvim ---1. auto_apply_diff_after_generation: Whether to automatically apply diff after LLM response. --- This would simulate similar behaviour to cursor. Default to false. + ---2. cycle_between_open_buffers : Enable tab cycling between windows. Default to true behaviour = { + cycle_between_open_buffers = true, auto_apply_diff_after_generation = false, }, highlights = { diff --git a/lua/avante/sidebar.lua b/lua/avante/sidebar.lua index 101bd58..5f5a523 100644 --- a/lua/avante/sidebar.lua +++ b/lua/avante/sidebar.lua @@ -736,6 +736,9 @@ function Sidebar:refresh_winids() if self.winids.input then table.insert(winids, self.winids.input) end + if Config.behaviour.cycle_between_open_buffers and self.code.winid then + table.insert(winids, self.code.winid) + end local function switch_windows() local current_winid = api.nvim_get_current_win()