From 279fe6e7f9530c47e4b89a491524ec99077e633c Mon Sep 17 00:00:00 2001 From: GigabiteStudios Date: Fri, 19 Jun 2026 00:08:08 -0500 Subject: [PATCH] fix(ui): return to main view after staging diff --- src/ui/diff_viewer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ui/diff_viewer.cpp b/src/ui/diff_viewer.cpp index 75cf212..397a264 100644 --- a/src/ui/diff_viewer.cpp +++ b/src/ui/diff_viewer.cpp @@ -1008,8 +1008,10 @@ void DiffViewer::draw(RepositoryView& repository, GitManager& manager, AvatarCac if (pending_hunk >= 0 && pending_hunk < static_cast(hunks_.size())) { const bool cached = pending_action != HunkAction::discard; const bool reverse = pending_action != HunkAction::stage; - if (manager.applyPatch(repository, hunks_[pending_hunk].patch, cached, reverse, notice)) + if (manager.applyPatch(repository, hunks_[pending_hunk].patch, cached, reverse, notice)) { + if (pending_action == HunkAction::stage) close(); reload(repository, manager, notice); + } } } else if (mode_ == Mode::blame) { if (blame_lines_.empty()) {