From f761e83033547d840fe82dbab678c6636a84f49d Mon Sep 17 00:00:00 2001 From: Jaime Date: Mon, 17 Mar 2025 10:48:32 +0100 Subject: [PATCH] fix: update displayed response for the first chunk (#1594) If one is using avante.nvim with a non streaming LLM API the API response will only have a single chunk. So that if we don't update the displayed_response in the sidebar component, the output of the LLM will be removed from the sidebar when we complete the interaction with the LLM. This commit makes sure that the displayed_response is updated for the first chunk as well as subsequent ones. --- lua/avante/sidebar.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/avante/sidebar.lua b/lua/avante/sidebar.lua index 2f055b5..d3ab46a 100644 --- a/lua/avante/sidebar.lua +++ b/lua/avante/sidebar.lua @@ -2606,6 +2606,7 @@ function Sidebar:create_input_container(opts) if is_first_chunk then is_first_chunk = false self:update_content(content_prefix .. chunk, { scroll = scroll }) + displayed_response = cur_displayed_response return end local suffix = get_display_content_suffix(transformed)