Skip to content

Commit

Permalink
make all special commit windows closable
Browse files Browse the repository at this point in the history
  • Loading branch information
forgottosave committed Nov 15, 2024
1 parent a33cec3 commit 0e00935
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/core/commit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,13 @@ class CommitComponentImpl : public ComponentBase, public WindowOptions {
return true;
}

// exit special window
if (ostreetui.GetViewMode() != ViewMode::DEFAULT && event == Event::Escape) {
cancelSpecialWindow();
return true;
}

// promotion window specific
if (ostreetui.GetViewMode() == ViewMode::COMMIT_PROMOTION) {
// navigate promotion branches
if (event == Event::ArrowLeft) {
Expand All @@ -227,11 +234,6 @@ class CommitComponentImpl : public ComponentBase, public WindowOptions {
(it + 1) % ostreetui.GetColumnToBranchMap().size()));
return true;
}
// cancel
if (event == Event::Escape) {
cancelSpecialWindow();
return true;
}
}

if (!event.is_mouse()) {
Expand Down

0 comments on commit 0e00935

Please sign in to comment.