From 3a7277386feada184b34e6c66d3664b0917b1047 Mon Sep 17 00:00:00 2001 From: yetone Date: Wed, 12 Feb 2025 22:02:12 +0800 Subject: [PATCH] fix: mkdir for new file (#1257) --- lua/avante/sidebar.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/avante/sidebar.lua b/lua/avante/sidebar.lua index d0c2dfc..1835d3c 100644 --- a/lua/avante/sidebar.lua +++ b/lua/avante/sidebar.lua @@ -820,6 +820,8 @@ function Sidebar:apply(current_cursor) api.nvim_set_current_win(self.code.winid) for filepath, snippets in pairs(selected_snippets_map) do local bufnr = Utils.get_or_create_buffer_with_filepath(filepath) + local path_ = PPath:new(filepath) + path_:parent():mkdir({ parents = true, exists_ok = true }) insert_conflict_contents(bufnr, snippets) local process = function(winid) api.nvim_set_current_win(winid)