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()) {