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.
This commit is contained in:
Jaime
2025-03-17 10:48:32 +01:00
committed by GitHub
parent bf61e3c7e3
commit f761e83033

View File

@@ -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)