1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-02-03 13:21:56 +02:00

chore: change to work return-alt1 on all views

This commit is contained in:
Ryooooooga 2023-02-11 21:05:55 +09:00
parent 823d95a8c6
commit 39c20bc634
No known key found for this signature in database
GPG Key ID: 07CF200DFCC20C25
9 changed files with 50 additions and 0 deletions

View File

@ -251,6 +251,11 @@ func (gui *Gui) setKeyBindings(cancel context.CancelFunc, opts types.CreatePopup
Key: keybindings.GetKey(keybindingConfig.Universal.Return), Key: keybindings.GetKey(keybindingConfig.Universal.Return),
Handler: gui.wrappedConfirmationFunction(cancel, opts.HandleClose), Handler: gui.wrappedConfirmationFunction(cancel, opts.HandleClose),
}, },
{
ViewName: "confirmation",
Key: keybindings.GetKey(keybindingConfig.Universal.ReturnAlt1),
Handler: gui.wrappedConfirmationFunction(cancel, opts.HandleClose),
},
{ {
ViewName: "confirmation", ViewName: "confirmation",
Key: keybindings.GetKey(keybindingConfig.Universal.TogglePanel), Key: keybindings.GetKey(keybindingConfig.Universal.TogglePanel),
@ -276,6 +281,11 @@ func (gui *Gui) setKeyBindings(cancel context.CancelFunc, opts types.CreatePopup
Key: keybindings.GetKey(keybindingConfig.Universal.Return), Key: keybindings.GetKey(keybindingConfig.Universal.Return),
Handler: gui.wrappedConfirmationFunction(cancel, opts.HandleClose), Handler: gui.wrappedConfirmationFunction(cancel, opts.HandleClose),
}, },
{
ViewName: "suggestions",
Key: keybindings.GetKey(keybindingConfig.Universal.ReturnAlt1),
Handler: gui.wrappedConfirmationFunction(cancel, opts.HandleClose),
},
{ {
ViewName: "suggestions", ViewName: "suggestions",
Key: keybindings.GetKey(keybindingConfig.Universal.TogglePanel), Key: keybindings.GetKey(keybindingConfig.Universal.TogglePanel),
@ -297,9 +307,11 @@ func (gui *Gui) clearConfirmationViewKeyBindings() {
_ = gui.g.DeleteKeybinding("confirmation", keybindings.GetKey(keybindingConfig.Universal.Confirm), gocui.ModNone) _ = 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.ConfirmAlt1), gocui.ModNone)
_ = gui.g.DeleteKeybinding("confirmation", keybindings.GetKey(keybindingConfig.Universal.Return), 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.Confirm), gocui.ModNone)
_ = gui.g.DeleteKeybinding("suggestions", keybindings.GetKey(keybindingConfig.Universal.ConfirmAlt1), 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.Return), gocui.ModNone)
_ = gui.g.DeleteKeybinding("suggestions", keybindings.GetKey(keybindingConfig.Universal.ReturnAlt1), gocui.ModNone)
} }
func (gui *Gui) refreshSuggestions() { func (gui *Gui) refreshSuggestions() {

View File

@ -41,6 +41,10 @@ func (self *CommitMessageController) GetKeybindings(opts types.KeybindingsOpts)
Key: opts.GetKey(opts.Config.Universal.Return), Key: opts.GetKey(opts.Config.Universal.Return),
Handler: self.close, Handler: self.close,
}, },
{
Key: opts.GetKey(opts.Config.Universal.ReturnAlt1),
Handler: self.close,
},
} }
return bindings return bindings

View File

@ -39,6 +39,10 @@ func (self *MenuController) GetKeybindings(opts types.KeybindingsOpts) []*types.
Key: opts.GetKey(opts.Config.Universal.Return), Key: opts.GetKey(opts.Config.Universal.Return),
Handler: self.close, Handler: self.close,
}, },
{
Key: opts.GetKey(opts.Config.Universal.ReturnAlt1),
Handler: self.close,
},
} }
return bindings return bindings

View File

@ -110,6 +110,11 @@ func (self *MergeConflictsController) GetKeybindings(opts types.KeybindingsOpts)
Handler: self.Escape, Handler: self.Escape,
Description: self.c.Tr.ReturnToFilesPanel, Description: self.c.Tr.ReturnToFilesPanel,
}, },
{
Key: opts.GetKey(opts.Config.Universal.ReturnAlt1),
Handler: self.Escape,
Description: self.c.Tr.ReturnToFilesPanel,
},
} }
return bindings return bindings

View File

@ -44,6 +44,11 @@ func (self *PatchBuildingController) GetKeybindings(opts types.KeybindingsOpts)
Handler: self.Escape, Handler: self.Escape,
Description: self.c.Tr.ExitCustomPatchBuilder, Description: self.c.Tr.ExitCustomPatchBuilder,
}, },
{
Key: opts.GetKey(opts.Config.Universal.ReturnAlt1),
Handler: self.Escape,
Description: self.c.Tr.ExitCustomPatchBuilder,
},
} }
} }

View File

@ -64,6 +64,11 @@ func (self *RemoteBranchesController) GetKeybindings(opts types.KeybindingsOpts)
Handler: self.escape, Handler: self.escape,
Description: self.c.Tr.ReturnToRemotesList, 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), Key: opts.GetKey(opts.Config.Commits.ViewResetOptions),
Handler: self.checkSelected(self.createResetMenu), Handler: self.checkSelected(self.createResetMenu),

View File

@ -47,6 +47,10 @@ func (self *SnakeController) GetKeybindings(opts types.KeybindingsOpts) []*types
Key: opts.GetKey(opts.Config.Universal.Return), Key: opts.GetKey(opts.Config.Universal.Return),
Handler: self.Escape, Handler: self.Escape,
}, },
{
Key: opts.GetKey(opts.Config.Universal.ReturnAlt1),
Handler: self.Escape,
},
} }
return bindings return bindings

View File

@ -53,6 +53,11 @@ func (self *StagingController) GetKeybindings(opts types.KeybindingsOpts) []*typ
Handler: self.Escape, Handler: self.Escape,
Description: self.c.Tr.ReturnToFilesPanel, 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), Key: opts.GetKey(opts.Config.Universal.TogglePanel),
Handler: self.TogglePanel, Handler: self.TogglePanel,

View File

@ -331,6 +331,12 @@ func (self *Gui) GetInitialKeybindings() ([]*types.Binding, []*gocui.ViewMouseBi
Modifier: gocui.ModNone, Modifier: gocui.ModNone,
Handler: self.handleSearchEscape, Handler: self.handleSearchEscape,
}, },
{
ViewName: "search",
Key: opts.GetKey(opts.Config.Universal.ReturnAlt1),
Modifier: gocui.ModNone,
Handler: self.handleSearchEscape,
},
{ {
ViewName: "confirmation", ViewName: "confirmation",
Key: opts.GetKey(opts.Config.Universal.PrevItem), Key: opts.GetKey(opts.Config.Universal.PrevItem),