refactor: cleanup diff highlights (#247)

make sure to run on scheme change

Signed-off-by: Aaron Pham <contact@aarnphm.xyz>
This commit is contained in:
Aaron Pham
2024-08-26 17:18:37 -04:00
committed by GitHub
parent b874045885
commit 72ba4ad52e
5 changed files with 106 additions and 82 deletions

View File

@@ -64,6 +64,8 @@ H.keymaps = function()
})
end
H.augroup = api.nvim_create_augroup("avante-autocmds", { clear = true })
H.autocmds = function()
local ok, LazyConfig = pcall(require, "lazy.core.config")
@@ -95,6 +97,7 @@ H.autocmds = function()
end
api.nvim_create_autocmd("TabEnter", {
group = H.augroup,
pattern = "*",
once = true,
callback = function(ev)
@@ -107,6 +110,7 @@ H.autocmds = function()
})
api.nvim_create_autocmd("TabClosed", {
group = H.augroup,
pattern = "*",
callback = function(ev)
local tab = tonumber(ev.file)
@@ -131,6 +135,13 @@ H.autocmds = function()
end
end)
api.nvim_create_autocmd("ColorSchemePre", {
group = H.augroup,
callback = function()
require("avante.highlights").setup()
end,
})
-- automatically setup Avante filetype to markdown
vim.treesitter.language.register("markdown", "Avante")
end