fix: parent dir not exists when write a file (#1732)

This commit is contained in:
yetone
2025-03-26 21:24:54 +08:00
committed by GitHub
parent 31f9519912
commit 6430d61f0a

View File

@@ -66,6 +66,7 @@ function M.func(opts, on_log, on_complete)
return
end
-- save the file
Path:new(abs_path):parent():mkdir({ parents = true, exists_ok = true })
local current_winid = vim.api.nvim_get_current_win()
local winid = Utils.get_winid(bufnr)
vim.api.nvim_set_current_win(winid)