From e55f9f753f2495e30f1af3a174362b39e24fb1d2 Mon Sep 17 00:00:00 2001 From: Hanchin Hsieh Date: Wed, 4 Sep 2024 18:34:53 +0800 Subject: [PATCH] fix(avante/path): incorrect handle of windows path (#522) Signed-off-by: Hanchin Hsieh --- lua/avante/path.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/avante/path.lua b/lua/avante/path.lua index 4327abe..ba21939 100644 --- a/lua/avante/path.lua +++ b/lua/avante/path.lua @@ -76,6 +76,7 @@ N.get = function(bufnr) -- get root directory of given bufnr local directory = Path:new(Utils.root.get({ buf = bufnr })) + if Utils.get_os_name() == "windows" then directory = Path:new(directory:absolute():gsub("^%a:", "")[1]) end ---@cast directory Path ---@type Path local cache_prompt_dir = P.cache_path:joinpath(directory)