summaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorLuka Markušić <luka.markusic@microblink.com>2023-03-09 10:29:20 +0100
committerLuka Markušić <luka.markusic@microblink.com>2023-03-09 10:32:00 +0100
commitf314cb37630fc444e11e89e6e10799f9bb6195b0 (patch)
tree00603e41a490ed0436ab37bd0c01372944e7f008 /pkg
parent82fc6fb111ba94aaabf78a00396e69689b860655 (diff)
Remove alternative confirmation and return keymappings
Diffstat (limited to 'pkg')
-rw-r--r--pkg/config/user_config.go4
-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
10 files changed, 0 insertions, 76 deletions
diff --git a/pkg/config/user_config.go b/pkg/config/user_config.go
index a4fc71579..57acb2b08 100644
--- a/pkg/config/user_config.go
+++ b/pkg/config/user_config.go
@@ -137,7 +137,6 @@ type KeybindingUniversalConfig struct {
Quit string `yaml:"quit"`
QuitAlt1 string `yaml:"quit-alt1"`
Return string `yaml:"return"`
- ReturnAlt1 string `yaml:"return-alt1"`
QuitWithoutChangingDirectory string `yaml:"quitWithoutChangingDirectory"`
TogglePanel string `yaml:"togglePanel"`
PrevItem string `yaml:"prevItem"`
@@ -165,7 +164,6 @@ type KeybindingUniversalConfig struct {
Select string `yaml:"select"`
GoInto string `yaml:"goInto"`
Confirm string `yaml:"confirm"`
- ConfirmAlt1 string `yaml:"confirm-alt1"`
Remove string `yaml:"remove"`
New string `yaml:"new"`
Edit string `yaml:"edit"`
@@ -427,7 +425,6 @@ func GetDefaultConfig() *UserConfig {
Quit: "q",
QuitAlt1: "<c-c>",
Return: "<esc>",
- ReturnAlt1: "",
QuitWithoutChangingDirectory: "Q",
TogglePanel: "<tab>",
PrevItem: "<up>",
@@ -455,7 +452,6 @@ func GetDefaultConfig() *UserConfig {
Select: "<space>",
GoInto: "<enter>",
Confirm: "<enter>",
- ConfirmAlt1: "y",
Remove: "d",
New: "n",
Edit: "e",
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 b2d60b770..798472f7f 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 0cddfb841..e06421809 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,