Skip to content

Commit 89a2df9

Browse files
committed
Add autocmd to refresh open buffers after making changes in neogit.
1 parent 00038cc commit 89a2df9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lua/neogit/autocmds.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ function M.setup()
4646
autocmd_disabled = args.event == "QuickFixCmdPre"
4747
end,
4848
})
49+
50+
-- Ensure vim buffers are updated
51+
api.nvim_create_autocmd("User", {
52+
pattern = "NeogitStatusRefreshed",
53+
callback = function()
54+
vim.cmd("set autoread | checktime")
55+
end,
56+
})
4957
end
5058

5159
return M

0 commit comments

Comments
 (0)