Moved neogit autocmds to nvim-tree

Signed-off-by: Taken <taken@mairimashita.org>
This commit is contained in:
2023-09-18 11:00:35 +02:00
parent 4666e7cf1d
commit 26a4ef7209
2 changed files with 26 additions and 24 deletions

View File

@@ -24,5 +24,31 @@ return {
},
},
})
local autocmd = vim.api.nvim_create_autocmd
local augroup = vim.api.nvim_create_augroup
local neogitCmds = augroup("MyCustomNeogitEvents", { clear = true })
autocmd("User", {
pattern = "NeogitPushComplete",
group = neogitCmds,
callback = function()
require("nvim-tree.api").tree.reload()
end,
})
autocmd("User", {
pattern = "NeogitPullComplete",
group = neogitCmds,
callback = function()
require("nvim-tree.api").tree.reload()
end,
})
autocmd("User", {
pattern = "NeogitFetchComplete",
group = neogitCmds,
callback = function()
require("nvim-tree.api").tree.reload()
end,
})
end,
}