fix: history storage path and delete clear memory (#2153)
This commit is contained in:
@@ -419,7 +419,7 @@ M._defaults = {
|
|||||||
history = {
|
history = {
|
||||||
max_tokens = 4096,
|
max_tokens = 4096,
|
||||||
carried_entry_count = nil,
|
carried_entry_count = nil,
|
||||||
storage_path = vim.fn.stdpath("state") .. "/avante",
|
storage_path = Utils.join_paths(vim.fn.stdpath("state"), "avante"),
|
||||||
paste = {
|
paste = {
|
||||||
extension = "png",
|
extension = "png",
|
||||||
filename = "pasted-%Y-%m-%d-%H-%M-%S",
|
filename = "pasted-%Y-%m-%d-%H-%M-%S",
|
||||||
|
|||||||
@@ -298,11 +298,11 @@ function P.setup()
|
|||||||
if not history_path:exists() then history_path:mkdir({ parents = true }) end
|
if not history_path:exists() then history_path:mkdir({ parents = true }) end
|
||||||
P.history_path = history_path
|
P.history_path = history_path
|
||||||
|
|
||||||
local cache_path = Path:new(vim.fn.stdpath("cache") .. "/avante")
|
local cache_path = Path:new(Utils.join_paths(vim.fn.stdpath("cache"), "avante"))
|
||||||
if not cache_path:exists() then cache_path:mkdir({ parents = true }) end
|
if not cache_path:exists() then cache_path:mkdir({ parents = true }) end
|
||||||
P.cache_path = cache_path
|
P.cache_path = cache_path
|
||||||
|
|
||||||
local data_path = Path:new(vim.fn.stdpath("data") .. "/avante")
|
local data_path = Path:new(Utils.join_paths(vim.fn.stdpath("data"), "avante"))
|
||||||
if not data_path:exists() then data_path:mkdir({ parents = true }) end
|
if not data_path:exists() then data_path:mkdir({ parents = true }) end
|
||||||
P.data_path = data_path
|
P.data_path = data_path
|
||||||
|
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ cmd("Clear", function(opts)
|
|||||||
end, {
|
end, {
|
||||||
desc = "avante: clear history, memory or cache",
|
desc = "avante: clear history, memory or cache",
|
||||||
nargs = "?",
|
nargs = "?",
|
||||||
complete = function(_, _, _) return { "history", "memory", "cache" } end,
|
complete = function(_, _, _) return { "history", "cache" } end,
|
||||||
})
|
})
|
||||||
cmd("ShowRepoMap", function() require("avante.repo_map").show() end, { desc = "avante: show repo map" })
|
cmd("ShowRepoMap", function() require("avante.repo_map").show() end, { desc = "avante: show repo map" })
|
||||||
cmd("Models", function() require("avante.model_selector").open() end, { desc = "avante: show models" })
|
cmd("Models", function() require("avante.model_selector").open() end, { desc = "avante: show models" })
|
||||||
|
|||||||
Reference in New Issue
Block a user