fix(avante/path): incorrect handle of windows path (#522)

Signed-off-by: Hanchin Hsieh <me@yuchanns.xyz>
This commit is contained in:
Hanchin Hsieh 2024-09-04 18:34:53 +08:00 committed by GitHub
parent 158170f9ed
commit e55f9f753f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -76,6 +76,7 @@ N.get = function(bufnr)
-- get root directory of given bufnr -- get root directory of given bufnr
local directory = Path:new(Utils.root.get({ buf = 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 ---@cast directory Path
---@type Path ---@type Path
local cache_prompt_dir = P.cache_path:joinpath(directory) local cache_prompt_dir = P.cache_path:joinpath(directory)