From 212797a2f27d15ef5f0e8b3727a2c0a245ea5f8d Mon Sep 17 00:00:00 2001 From: Ahmed Siddiqui <36286128+AhmedNSidd@users.noreply.github.com> Date: Tue, 19 Aug 2025 03:39:08 -0400 Subject: [PATCH] Add config to limit max height for selected files (#2618) --- lua/avante/config.lua | 3 +++ lua/avante/sidebar.lua | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lua/avante/config.lua b/lua/avante/config.lua index c6836ca..c61cd33 100644 --- a/lua/avante/config.lua +++ b/lua/avante/config.lua @@ -627,6 +627,9 @@ M._defaults = { prefix = "> ", height = 8, -- Height of the input window in vertical layout }, + selected_files = { + height = 6, -- Maximum height of the selected files window + }, edit = { border = { " ", " ", " ", " ", " ", " ", " ", " " }, start_insert = true, -- Start insert mode when opening the edit window diff --git a/lua/avante/sidebar.lua b/lua/avante/sidebar.lua index 70aac21..b7a94fc 100644 --- a/lua/avante/sidebar.lua +++ b/lua/avante/sidebar.lua @@ -2963,7 +2963,7 @@ end function Sidebar:get_selected_files_container_height() local selected_filepaths_ = self.file_selector:get_selected_filepaths() - return math.min(vim.o.lines - 2, #selected_filepaths_ + 1) + return math.min(Config.windows.selected_files.height, #selected_filepaths_ + 1) end function Sidebar:adjust_selected_files_container_layout()