From 0e009355b52ffe930534658c0888d37e16742ea9 Mon Sep 17 00:00:00 2001 From: Timon Ensel Date: Fri, 15 Nov 2024 23:22:20 +0100 Subject: [PATCH] make all special commit windows closable --- src/core/commit.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/core/commit.cpp b/src/core/commit.cpp index 13afcc7..7aba9c6 100644 --- a/src/core/commit.cpp +++ b/src/core/commit.cpp @@ -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) { @@ -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()) {