diff --git a/lua/avante/config.lua b/lua/avante/config.lua index 004d2e6..e2ca5c2 100644 --- a/lua/avante/config.lua +++ b/lua/avante/config.lua @@ -27,6 +27,9 @@ M.defaults = { temperature = 0, max_tokens = 4096, }, + behaviour = { + auto_apply_diff_after_generation = false, -- Whether to automatically apply diff after LLM response. + }, highlights = { ---@type AvanteConflictHighlights diff = { diff --git a/lua/avante/sidebar.lua b/lua/avante/sidebar.lua index 3755b0c..2f9c303 100644 --- a/lua/avante/sidebar.lua +++ b/lua/avante/sidebar.lua @@ -659,16 +659,15 @@ function Sidebar:render() end ) - api.nvim_set_current_win(self.winid.result) - - -- Display notification - -- show_notification("Content generation complete!") - -- Save chat history table.insert(chat_history or {}, { timestamp = timestamp, requirement = user_input, response = full_response }) save_chat_history(self, chat_history) end ) + + if Config.behaviour.auto_apply_diff_after_generation then + apply() + end end local body = function()