summaryrefslogtreecommitdiffstats
path: root/pkg/gui
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2023-03-20 20:11:35 +1100
committerGitHub <noreply@github.com>2023-03-20 20:11:35 +1100
commita82d952f482b285ece07adbaa4f1284d863054fa (patch)
treedcdaec4ed8528f090be656dd71f4c84db297f61a /pkg/gui
parentcef804f27aaaec6a728bf1c0df89df2ffb355669 (diff)
parentf314cb37630fc444e11e89e6e10799f9bb6195b0 (diff)
Merge pull request #2495 from jesseduffield/feature/remove-altreturn
Diffstat (limited to 'pkg/gui')
-rw-r--r--pkg/gui/confirmation_panel.go24
-rw-r--r--pkg/gui/controllers/commit_message_controller.go4
-rw-r--r--pkg/gui/controllers/menu_controller.go8
-rw-r--r--pkg/gui/controllers/merge_conflicts_controller.go5
-rw-r--r--pkg/gui/controllers/patch_building_controller.go5
-rw-r--r--pkg/gui/controllers/remote_branches_controller.go5
-rw-r--r--pkg/gui/controllers/snake_controller.go4
-rw-r--r--pkg/gui/controllers/staging_controller.go5
-rw-r--r--pkg/gui/keybindings.go12
9 files changed, 0 insertions, 72 deletions
diff --git a/pkg/gui/confirmation_panel.go b/pkg/gui/confirmation_panel.go
index a60017688..c3e50c2a1 100644
--- a/pkg/gui/confirmation_panel.go
+++ b/pkg/gui/confirmation_panel.go
@@ -243,21 +243,11 @@ func (gui *Gui) setKeyBindings(cancel context.CancelFunc, opts types.CreatePopup
},
{
ViewName: "confirmation",
- Key: keybindings.GetKey(keybindingConfig.Universal.ConfirmAlt1),
- Handler: onConfirm,
- },
- {
- ViewName: "confirmation",
Key: keybindings.GetKey(keybindingConfig.Universal.Return),
Handler: gui.wrappedConfirmationFunction(cancel, opts.HandleClose),
},
{
ViewName: "confirmation",
- Key: keybindings.GetKey(keybindingConfig.Universal.ReturnAlt1),
- Handler: gui.wrappedConfirmationFunction(cancel, opts.HandleClose),
- },
- {
- ViewName: "confirmation",
Key: keybindings.GetKey(keybindingConfig.Universal.TogglePanel),
Handler: func() error {
if len(gui.State.Suggestions) > 0 {
@@ -273,21 +263,11 @@ func (gui *Gui) setKeyBindings(cancel context.CancelFunc, opts types.CreatePopup
},
{
ViewName: "suggestions",
- Key: keybindings.GetKey(keybindingConfig.Universal.ConfirmAlt1),
- Handler: onSuggestionConfirm,
- },
- {
- ViewName: "suggestions",
Key: keybindings.GetKey(keybindingConfig.Universal.Return),
Handler: gui.wrappedConfirmationFunction(cancel, opts.HandleClose),
},
{
ViewName: "suggestions",
- Key: keybindings.GetKey(keybindingConfig.Universal.ReturnAlt1),
- Handler: gui.wrappedConfirmationFunction(cancel, opts.HandleClose),
- },
- {
- ViewName: "suggestions",
Key: keybindings.GetKey(keybindingConfig.Universal.TogglePanel),
Handler: func() error { return gui.replaceContext(gui.State.Contexts.Confirmation) },
},
@@ -305,13 +285,9 @@ func (gui *Gui) setKeyBindings(cancel context.CancelFunc, opts types.CreatePopup
func (gui *Gui) clearConfirmationViewKeyBindings() {
keybindingConfig := gui.c.UserConfig.Keybinding
_ = gui.g.DeleteKeybinding("confirmation", keybindings.GetKey(keybindingConfig.Universal.Confirm), gocui.ModNone)
- _ = gui.g.DeleteKeybinding("confirmation", keybindings.GetKey(keybindingConfig.Universal.ConfirmAlt1), gocui.ModNone)
_ = gui.g.DeleteKeybinding("confirmation", keybindings.GetKey(keybindingConfig.Universal.Return), gocui.ModNone)
- _ = gui.g.DeleteKeybinding("confirmation", keybindings.GetKey(keybindingConfig.Universal.ReturnAlt1), gocui.ModNone)
_ = gui.g.DeleteKeybinding("suggestions", keybindings.GetKey(keybindingConfig.Universal.Confirm), gocui.ModNone)
- _ = gui.g.DeleteKeybinding("suggestions", keybindings.GetKey(keybindingConfig.Universal.ConfirmAlt1), gocui.ModNone)
_ = gui.g.DeleteKeybinding("suggestions", keybindings.GetKey(keybindingConfig.Universal.Return), gocui.ModNone)
- _ = gui.g.DeleteKeybinding("suggestions", keybindings.GetKey(keybindingConfig.Universal.ReturnAlt1), gocui.ModNone)
}
func (gui *Gui) refreshSuggestions() {
diff --git a/pkg/gui/controllers/commit_message_controller.go b/pkg/gui/controllers/commit_message_controller.go
index 4e3ccd6e2..e5cdb866d 100644
--- a/pkg/gui/controllers/commit_message_controller.go
+++ b/pkg/gui/controllers/commit_message_controller.go
@@ -41,10 +41,6 @@ func (self *CommitMessageController) GetKeybindings(opts types.KeybindingsOpts)
Key: opts.GetKey(opts.Config.Universal.Return),
Handler: self.close,
},
- {
- Key: opts.GetKey(opts.Config.Universal.ReturnAlt1),
- Handler: self.close,
- },
}
return bindings
diff --git a/pkg/gui/controllers/menu_controller.go b/pkg/gui/controllers/menu_controller.go
index 4c84a82de..6700fa99d 100644
--- a/pkg/gui/controllers/menu_controller.go
+++ b/pkg/gui/controllers/menu_controller.go
@@ -32,17 +32,9 @@ func (self *MenuController) GetKeybindings(opts types.KeybindingsOpts) []*types.
Handler: self.press,
},
{
- Key: opts.GetKey(opts.Config.Universal.ConfirmAlt1),
- Handler: self.press,
- },
- {
Key: opts.GetKey(opts.Config.Universal.Return),
Handler: self.close,
},
- {
- Key: opts.GetKey(opts.Config.Universal.ReturnAlt1),
- Handler: self.close,
- },
}
return bindings
diff --git a/pkg/gui/controllers/merge_conflicts_controller.go b/pkg/gui/controllers/merge_conflicts_controller.go
index b35f846c2..7cfcfa62d 100644
--- a/pkg/gui/controllers/merge_conflicts_controller.go
+++ b/pkg/gui/controllers/merge_conflicts_controller.go
@@ -110,11 +110,6 @@ func (self *MergeConflictsController) GetKeybindings(opts types.KeybindingsOpts)
Handler: self.Escape,
Description: self.c.Tr.ReturnToFilesPanel,
},
- {
- Key: opts.GetKey(opts.Config.Universal.ReturnAlt1),
- Handler: self.Escape,
- Description: self.c.Tr.ReturnToFilesPanel,
- },
}
return bindings
diff --git a/pkg/gui/controllers/patch_building_controller.go b/pkg/gui/controllers/patch_building_controller.go
index abbb4bdd1..613aadd1d 100644
--- a/pkg/gui/controllers/patch_building_controller.go
+++ b/pkg/gui/controllers/patch_building_controller.go
@@ -44,11 +44,6 @@ func (self *PatchBuildingController) GetKeybindings(opts types.KeybindingsOpts)
Handler: self.Escape,
Description: self.c.Tr.ExitCustomPatchBuilder,
},
- {
- Key: opts.GetKey(opts.Config.Universal.ReturnAlt1),
- Handler: self.Escape,
- Description: self.c.Tr.ExitCustomPatchBuilder,
- },
}
}
diff --git a/pkg/gui/controllers/remote_branches_controller.go b/pkg/gui/controllers/remote_branches_controller.go
index 2f1382345..dcedde8c0 100644
--- a/pkg/gui/controllers/remote_branches_controller.go
+++ b/pkg/gui/controllers/remote_branches_controller.go
@@ -65,11 +65,6 @@ func (self *RemoteBranchesController) GetKeybindings(opts types.KeybindingsOpts)
Description: self.c.Tr.ReturnToRemotesList,
},
{
- Key: opts.GetKey(opts.Config.Universal.ReturnAlt1),
- Handler: self.escape,
- Description: self.c.Tr.ReturnToRemotesList,
- },
- {
Key: opts.GetKey(opts.Config.Commits.ViewResetOptions),
Handler: self.checkSelected(self.createResetMenu),
Description: self.c.Tr.LcViewResetOptions,
diff --git a/pkg/gui/controllers/snake_controller.go b/pkg/gui/controllers/snake_controller.go
index 4956c0c79..4217878e3 100644
--- a/pkg/gui/controllers/snake_controller.go
+++ b/pkg/gui/controllers/snake_controller.go
@@ -47,10 +47,6 @@ func (self *SnakeController) GetKeybindings(opts types.KeybindingsOpts) []*types
Key: opts.GetKey(opts.Config.Universal.Return),
Handler: self.Escape,
},
- {
- Key: opts.GetKey(opts.Config.Universal.ReturnAlt1),
- Handler: self.Escape,
- },
}
return bindings
diff --git a/pkg/gui/controllers/staging_controller.go b/pkg/gui/controllers/staging_controller.go
index 0738ae1dc..1d8a24b95 100644
--- a/pkg/gui/controllers/staging_controller.go
+++ b/pkg/gui/controllers/staging_controller.go
@@ -54,11 +54,6 @@ func (self *StagingController) GetKeybindings(opts types.KeybindingsOpts) []*typ
Description: self.c.Tr.ReturnToFilesPanel,
},
{
- Key: opts.GetKey(opts.Config.Universal.ReturnAlt1),
- Handler: self.Escape,
- Description: self.c.Tr.ReturnToFilesPanel,
- },
- {
Key: opts.GetKey(opts.Config.Universal.TogglePanel),
Handler: self.TogglePanel,
Description: self.c.Tr.ToggleStagingPanel,
diff --git a/pkg/gui/keybindings.go b/pkg/gui/keybindings.go
index 291c92288..b63c91905 100644
--- a/pkg/gui/keybindings.go
+++ b/pkg/gui/keybindings.go
@@ -75,12 +75,6 @@ func (self *Gui) GetInitialKeybindings() ([]*types.Binding, []*gocui.ViewMouseBi
Handler: self.handleTopLevelReturn,
},
{
- ViewName: "",
- Key: opts.GetKey(opts.Config.Universal.ReturnAlt1),
- Modifier: gocui.ModNone,
- Handler: self.handleTopLevelReturn,
- },
- {
ViewName: "",
Key: opts.GetKey(opts.Config.Universal.OpenRecentRepos),
Handler: self.handleCreateRecentReposMenu,
@@ -334,12 +328,6 @@ func (self *Gui) GetInitialKeybindings() ([]*types.Binding, []*gocui.ViewMouseBi
Handler: self.handleSearchEscape,
},
{
- ViewName: "search",
- Key: opts.GetKey(opts.Config.Universal.ReturnAlt1),
- Modifier: gocui.ModNone,
- Handler: self.handleSearchEscape,
- },
- {
ViewName: "confirmation",
Key: opts.GetKey(opts.Config.Universal.PrevItem),
Modifier: gocui.ModNone,