mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-01-22 05:29:44 +02:00
Merge pull request #2495 from jesseduffield/feature/remove-altreturn
This commit is contained in:
commit
a82d952f48
@ -116,8 +116,6 @@ keybinding:
|
|||||||
quit: 'q'
|
quit: 'q'
|
||||||
quit-alt1: '<c-c>' # alternative/alias of quit
|
quit-alt1: '<c-c>' # alternative/alias of quit
|
||||||
return: '<esc>' # return to previous menu, will quit if there's nowhere to return
|
return: '<esc>' # return to previous menu, will quit if there's nowhere to return
|
||||||
# When set to a printable character, this will work for returning from non-prompt panels
|
|
||||||
return-alt1: null
|
|
||||||
quitWithoutChangingDirectory: 'Q'
|
quitWithoutChangingDirectory: 'Q'
|
||||||
togglePanel: '<tab>' # goto the next panel
|
togglePanel: '<tab>' # goto the next panel
|
||||||
prevItem: '<up>' # go one line up
|
prevItem: '<up>' # go one line up
|
||||||
@ -143,7 +141,6 @@ keybinding:
|
|||||||
goInto: '<enter>'
|
goInto: '<enter>'
|
||||||
openRecentRepos: '<c-r>'
|
openRecentRepos: '<c-r>'
|
||||||
confirm: '<enter>'
|
confirm: '<enter>'
|
||||||
confirm-alt1: 'y'
|
|
||||||
remove: 'd'
|
remove: 'd'
|
||||||
new: 'n'
|
new: 'n'
|
||||||
edit: 'e'
|
edit: 'e'
|
||||||
|
@ -138,7 +138,6 @@ type KeybindingUniversalConfig struct {
|
|||||||
Quit string `yaml:"quit"`
|
Quit string `yaml:"quit"`
|
||||||
QuitAlt1 string `yaml:"quit-alt1"`
|
QuitAlt1 string `yaml:"quit-alt1"`
|
||||||
Return string `yaml:"return"`
|
Return string `yaml:"return"`
|
||||||
ReturnAlt1 string `yaml:"return-alt1"`
|
|
||||||
QuitWithoutChangingDirectory string `yaml:"quitWithoutChangingDirectory"`
|
QuitWithoutChangingDirectory string `yaml:"quitWithoutChangingDirectory"`
|
||||||
TogglePanel string `yaml:"togglePanel"`
|
TogglePanel string `yaml:"togglePanel"`
|
||||||
PrevItem string `yaml:"prevItem"`
|
PrevItem string `yaml:"prevItem"`
|
||||||
@ -166,7 +165,6 @@ type KeybindingUniversalConfig struct {
|
|||||||
Select string `yaml:"select"`
|
Select string `yaml:"select"`
|
||||||
GoInto string `yaml:"goInto"`
|
GoInto string `yaml:"goInto"`
|
||||||
Confirm string `yaml:"confirm"`
|
Confirm string `yaml:"confirm"`
|
||||||
ConfirmAlt1 string `yaml:"confirm-alt1"`
|
|
||||||
Remove string `yaml:"remove"`
|
Remove string `yaml:"remove"`
|
||||||
New string `yaml:"new"`
|
New string `yaml:"new"`
|
||||||
Edit string `yaml:"edit"`
|
Edit string `yaml:"edit"`
|
||||||
@ -429,7 +427,6 @@ func GetDefaultConfig() *UserConfig {
|
|||||||
Quit: "q",
|
Quit: "q",
|
||||||
QuitAlt1: "<c-c>",
|
QuitAlt1: "<c-c>",
|
||||||
Return: "<esc>",
|
Return: "<esc>",
|
||||||
ReturnAlt1: "",
|
|
||||||
QuitWithoutChangingDirectory: "Q",
|
QuitWithoutChangingDirectory: "Q",
|
||||||
TogglePanel: "<tab>",
|
TogglePanel: "<tab>",
|
||||||
PrevItem: "<up>",
|
PrevItem: "<up>",
|
||||||
@ -457,7 +454,6 @@ func GetDefaultConfig() *UserConfig {
|
|||||||
Select: "<space>",
|
Select: "<space>",
|
||||||
GoInto: "<enter>",
|
GoInto: "<enter>",
|
||||||
Confirm: "<enter>",
|
Confirm: "<enter>",
|
||||||
ConfirmAlt1: "y",
|
|
||||||
Remove: "d",
|
Remove: "d",
|
||||||
New: "n",
|
New: "n",
|
||||||
Edit: "e",
|
Edit: "e",
|
||||||
|
@ -241,21 +241,11 @@ func (gui *Gui) setKeyBindings(cancel context.CancelFunc, opts types.CreatePopup
|
|||||||
Key: keybindings.GetKey(keybindingConfig.Universal.Confirm),
|
Key: keybindings.GetKey(keybindingConfig.Universal.Confirm),
|
||||||
Handler: onConfirm,
|
Handler: onConfirm,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
ViewName: "confirmation",
|
|
||||||
Key: keybindings.GetKey(keybindingConfig.Universal.ConfirmAlt1),
|
|
||||||
Handler: onConfirm,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
ViewName: "confirmation",
|
ViewName: "confirmation",
|
||||||
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),
|
||||||
@ -271,21 +261,11 @@ func (gui *Gui) setKeyBindings(cancel context.CancelFunc, opts types.CreatePopup
|
|||||||
Key: keybindings.GetKey(keybindingConfig.Universal.Confirm),
|
Key: keybindings.GetKey(keybindingConfig.Universal.Confirm),
|
||||||
Handler: onSuggestionConfirm,
|
Handler: onSuggestionConfirm,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
ViewName: "suggestions",
|
|
||||||
Key: keybindings.GetKey(keybindingConfig.Universal.ConfirmAlt1),
|
|
||||||
Handler: onSuggestionConfirm,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
ViewName: "suggestions",
|
ViewName: "suggestions",
|
||||||
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),
|
||||||
@ -305,13 +285,9 @@ func (gui *Gui) setKeyBindings(cancel context.CancelFunc, opts types.CreatePopup
|
|||||||
func (gui *Gui) clearConfirmationViewKeyBindings() {
|
func (gui *Gui) clearConfirmationViewKeyBindings() {
|
||||||
keybindingConfig := gui.c.UserConfig.Keybinding
|
keybindingConfig := gui.c.UserConfig.Keybinding
|
||||||
_ = 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.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.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() {
|
||||||
|
@ -41,10 +41,6 @@ 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
|
||||||
|
@ -31,18 +31,10 @@ func (self *MenuController) GetKeybindings(opts types.KeybindingsOpts) []*types.
|
|||||||
Key: opts.GetKey(opts.Config.Universal.Confirm),
|
Key: opts.GetKey(opts.Config.Universal.Confirm),
|
||||||
Handler: self.press,
|
Handler: self.press,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
Key: opts.GetKey(opts.Config.Universal.ConfirmAlt1),
|
|
||||||
Handler: self.press,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
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
|
||||||
|
@ -110,11 +110,6 @@ 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
|
||||||
|
@ -44,11 +44,6 @@ 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,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,11 +64,6 @@ 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),
|
||||||
|
@ -47,10 +47,6 @@ 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
|
||||||
|
@ -53,11 +53,6 @@ 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,
|
||||||
|
@ -74,12 +74,6 @@ func (self *Gui) GetInitialKeybindings() ([]*types.Binding, []*gocui.ViewMouseBi
|
|||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: self.handleTopLevelReturn,
|
Handler: self.handleTopLevelReturn,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
ViewName: "",
|
|
||||||
Key: opts.GetKey(opts.Config.Universal.ReturnAlt1),
|
|
||||||
Modifier: gocui.ModNone,
|
|
||||||
Handler: self.handleTopLevelReturn,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
ViewName: "",
|
ViewName: "",
|
||||||
Key: opts.GetKey(opts.Config.Universal.OpenRecentRepos),
|
Key: opts.GetKey(opts.Config.Universal.OpenRecentRepos),
|
||||||
@ -333,12 +327,6 @@ 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),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user