From c3848d086c415c0492fc042b367036763f76fa4c Mon Sep 17 00:00:00 2001 From: Dennis Dillert Date: Sat, 5 Oct 2024 11:49:15 +0200 Subject: [PATCH] fix: ensure paths are recreated after calling :AvanteClear to avoid errors (#678) --- lua/avante/path.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/avante/path.lua b/lua/avante/path.lua index 46f20c5..c3136eb 100644 --- a/lua/avante/path.lua +++ b/lua/avante/path.lua @@ -181,6 +181,9 @@ P.available = function() return templates ~= nil end P.clear = function() P.cache_path:rm({ recursive = true }) P.history_path:rm({ recursive = true }) + + if not P.cache_path:exists() then P.cache_path:mkdir({ parents = true }) end + if not P.history_path:exists() then P.history_path:mkdir({ parents = true }) end end return P