From a5e23f50c172a168731666e23cc46312adbf1fb2 Mon Sep 17 00:00:00 2001 From: Meisterlala <6453306+Meisterlala@users.noreply.github.com> Date: Tue, 7 Jul 2026 17:00:05 +0200 Subject: [PATCH] fix(neogit): refresh status buffer after push/pull/fetch operations with autocmd add autocmd for `User NeogitPushComplete`, `User NeogitPullComplete`, and `User NeogitFetchComplete` events to ensure status updates immediately after Git operations without manual intervention. --- lua/plugins/neogit.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lua/plugins/neogit.lua b/lua/plugins/neogit.lua index 5c5d3fc..d3ce269 100644 --- a/lua/plugins/neogit.lua +++ b/lua/plugins/neogit.lua @@ -9,6 +9,16 @@ return { 'nvim-telescope/telescope.nvim', -- optional }, config = function() + vim.api.nvim_create_autocmd('User', { + pattern = { 'NeogitPushComplete', 'NeogitPullComplete', 'NeogitFetchComplete' }, + callback = function() + local status = require 'neogit.buffers.status' + if status.is_open() then + status.instance():dispatch_refresh(nil, 'neogit_remote_event') + end + end, + }) + require('neogit').setup { -- Hides the hints at the top of the status buffer disable_hint = false, -- 2.51.2