Add option custom_init to enable user to customize behaviour of sidebar (#2630)

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
This commit is contained in:
brook hong
2025-08-24 02:57:52 +08:00
committed by GitHub
parent 212797a2f2
commit 40af7113a2
4 changed files with 18 additions and 4 deletions

View File

@@ -94,6 +94,15 @@ function H.keymaps()
function() require("avante.api").ask() end,
{ desc = "avante: ask" }
)
Utils.safe_keymap_set({ "n", "v" }, Config.mappings.full_view_ask, function()
require("avante.api").ask({
sidebar_post_render = function(sidebar)
sidebar:toggle_code_window()
vim.wo[sidebar.containers.result.winid].number = true
vim.wo[sidebar.containers.result.winid].relativenumber = true
end,
})
end, { desc = "avante: ask with full result view" })
Utils.safe_keymap_set(
{ "n", "v" },
Config.mappings.new_ask,