summaryrefslogtreecommitdiffstats
path: root/pkg/gui/controllers/helpers
diff options
context:
space:
mode:
authorStefan Haller <stefan@haller-berlin.de>2023-05-31 18:29:01 +0200
committerStefan Haller <stefan@haller-berlin.de>2023-06-01 10:51:48 +0200
commit16dceb813baa6a2db14ffc46eef9204f4ddb09d3 (patch)
tree4237852bb1063e50108a6e454929223b7ce03539 /pkg/gui/controllers/helpers
parentc70c8e84f85a5ce98c02b305a6dc4ea6a9eb6be8 (diff)
Show menu instead of prompt when there are conflicts in a rebase or merge
This solves the issue that previously you could too easily abort a rebase accidentally by hitting escape.
Diffstat (limited to 'pkg/gui/controllers/helpers')
-rw-r--r--pkg/gui/controllers/helpers/merge_and_rebase_helper.go27
1 files changed, 19 insertions, 8 deletions
diff --git a/pkg/gui/controllers/helpers/merge_and_rebase_helper.go b/pkg/gui/controllers/helpers/merge_and_rebase_helper.go
index 0e67fd7ea..21ab44201 100644
--- a/pkg/gui/controllers/helpers/merge_and_rebase_helper.go
+++ b/pkg/gui/controllers/helpers/merge_and_rebase_helper.go
@@ -138,15 +138,26 @@ func (self *MergeAndRebaseHelper) CheckMergeOrRebase(result error) error {
// assume in this case that we're already done
return nil
} else if isMergeConflictErr(result.Error()) {
- return self.c.Confirm(types.ConfirmOpts{
- Title: self.c.Tr.FoundConflictsTitle,
- Prompt: self.c.Tr.FoundConflicts,
- HandleConfirm: func() error {
- return self.c.PushContext(self.c.Contexts().Files)
- },
- HandleClose: func() error {
- return self.genericMergeCommand(REBASE_OPTION_ABORT)
+ mode := self.workingTreeStateNoun()
+ return self.c.Menu(types.CreateMenuOptions{
+ Title: self.c.Tr.FoundConflictsTitle,
+ Items: []*types.MenuItem{
+ {
+ Label: self.c.Tr.ViewConflictsMenuItem,
+ OnPress: func() error {
+ return self.c.PushContext(self.c.Contexts().Files)
+ },
+ Key: 'v',
+ },
+ {
+ Label: fmt.Sprintf(self.c.Tr.AbortMenuItem, mode),
+ OnPress: func() error {
+ return self.genericMergeCommand(REBASE_OPTION_ABORT)
+ },
+ Key: 'a',
+ },
},
+ HideCancel: true,
})
} else {
return self.c.ErrorMsg(result.Error())