diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2019-11-05 12:42:19 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2019-11-05 19:22:01 +1100 |
commit | 61deaaddb7ee15356d5af41edb9e89a58bbf2ab9 (patch) | |
tree | 9ae6e778263b917a648618f586cdc0a5011e3d73 /pkg/gui/patch_options_panel.go | |
parent | 0046e9c469a86c22a98a6671c6d4802c4f8e74c5 (diff) |
reorder patch command options
Diffstat (limited to 'pkg/gui/patch_options_panel.go')
-rw-r--r-- | pkg/gui/patch_options_panel.go | 21 |
1 files 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 { |