31 lines
705 B
Lua
Raw Normal View History

2024-08-12 23:53:28 +08:00
local M = {}
2024-08-15 17:45:46 +08:00
local sidebar = require("avante.sidebar")
local config = require("avante.config")
2024-08-12 23:53:28 +08:00
function M.setup(opts)
local ok, LazyConfig = pcall(require, "lazy.core.config")
if ok then
local name = "avante.nvim"
if LazyConfig.plugins[name] and LazyConfig.plugins[name]._.loaded then
vim.schedule(function()
require("tiktoken_lib").load()
end)
else
vim.api.nvim_create_autocmd("User", {
pattern = "LazyLoad",
callback = function(event)
if event.data == name then
require("tiktoken_lib").load()
return true
end
end,
})
end
end
2024-08-15 17:45:46 +08:00
config.update(opts)
sidebar.setup()
2024-08-12 23:53:28 +08:00
end
return M