From 61deaaddb7ee15356d5af41edb9e89a58bbf2ab9 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Tue, 5 Nov 2019 12:42:19 +1100 Subject: reorder patch command options --- pkg/gui/patch_options_panel.go | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/pkg/gui/patch_options_panel.go b/pkg/gui/patch_options_panel.go index 41e3056a8..a55e0d4a7 100644 --- a/pkg/gui/patch_options_panel.go +++ b/pkg/gui/patch_options_panel.go @@ -23,18 +23,25 @@ func (gui *Gui) handleCreatePatchOptionsMenu(g *gocui.Gui, v *gocui.View) error } options := []*patchMenuOption{ - {displayName: "discard patch", function: gui.handleDeletePatchFromCommit}, + {displayName: fmt.Sprintf("remove patch from original commit (%s)", gui.GitCommand.PatchManager.CommitSha), function: gui.handleDeletePatchFromCommit}, {displayName: "pull patch out into index", function: gui.handlePullPatchIntoWorkingTree}, - {displayName: "save patch to file"}, - {displayName: "clear patch", function: gui.handleClearPatch}, + {displayName: "reset patch", function: gui.handleClearPatch}, } selectedCommit := gui.getSelectedCommit(gui.g) if selectedCommit != nil && gui.GitCommand.PatchManager.CommitSha != selectedCommit.Sha { - options = append(options, &patchMenuOption{ - displayName: fmt.Sprintf("move patch to selected commit (%s)", selectedCommit.Sha), - function: gui.handleMovePatchToSelectedCommit, - }) + // adding this option to index 1 + options = append( + options[:1], + append( + []*patchMenuOption{ + { + displayName: fmt.Sprintf("move patch to selected commit (%s)", selectedCommit.Sha), + function: gui.handleMovePatchToSelectedCommit, + }, + }, options[1:]..., + )..., + ) } handleMenuPress := func(index int) error { -- cgit v1.2.3