refactor(ai): streaming chunks to avoid excessive redraw. (#73)

* perf(ai): token streaming with quick refactoring

Signed-off-by: Aaron Pham <contact@aarnphm.xyz>

* fix: window resize and AvanteSwitchProvider

Signed-off-by: Aaron Pham <contact@aarnphm.xyz>

* revert: config change

Signed-off-by: Aaron Pham <contact@aarnphm.xyz>

* chore: return early

Signed-off-by: Aaron Pham <contact@aarnphm.xyz>

---------

Signed-off-by: Aaron Pham <contact@aarnphm.xyz>
This commit is contained in:
Aaron Pham
2024-08-18 15:03:25 -04:00
committed by GitHub
parent 0fddfc7d8f
commit 5fa4f701dd
6 changed files with 414 additions and 249 deletions

View File

@@ -143,14 +143,11 @@ function M._init(id)
return M
end
M.open = function()
M._init(api.nvim_get_current_tabpage())._get(false):open()
end
M.toggle = function()
local sidebar = M._get()
if not sidebar then
M.open()
M._init(api.nvim_get_current_tabpage())
M.current.sidebar:open()
return true
end