From 3fae794ea83d417d31929d052faeca0439307cc6 Mon Sep 17 00:00:00 2001 From: Jie Liu Date: Mon, 3 Mar 2025 15:08:39 +0800 Subject: [PATCH] fix: sub-folder creation on Windows (#1468) --- lua/avante/sidebar.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/avante/sidebar.lua b/lua/avante/sidebar.lua index b3de7b9..2a881cd 100644 --- a/lua/avante/sidebar.lua +++ b/lua/avante/sidebar.lua @@ -1320,7 +1320,7 @@ function Sidebar:apply(current_cursor) for filepath, snippets in pairs(selected_snippets_map) do if Config.behaviour.minimize_diff then snippets = self:minimize_snippets(filepath, snippets) end local bufnr = Utils.get_or_create_buffer_with_filepath(filepath) - local path_ = PPath:new(filepath) + local path_ = PPath:new(Utils.is_win() and filepath:gsub("/", "\\") or filepath) path_:parent():mkdir({ parents = true, exists_ok = true }) insert_conflict_contents(bufnr, snippets) local function process(winid)