Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pkg/config/user_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@ type KeybindingUniversalConfig struct {
QuitAlt1 string `yaml:"quit-alt1"`
SuspendApp string `yaml:"suspendApp"`
Return string `yaml:"return"`
ReturnAlt string `yaml:"return-alt"`
QuitWithoutChangingDirectory string `yaml:"quitWithoutChangingDirectory"`
TogglePanel string `yaml:"togglePanel"`
PrevItem string `yaml:"prevItem"`
Expand Down Expand Up @@ -899,6 +900,7 @@ func GetDefaultConfig() *UserConfig {
QuitAlt1: "<c-c>",
SuspendApp: "<c-z>",
Return: "<esc>",
ReturnAlt: "",
QuitWithoutChangingDirectory: "Q",
TogglePanel: "<tab>",
PrevItem: "<up>",
Expand Down
4 changes: 4 additions & 0 deletions pkg/gui/controllers/commit_description_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ func (self *CommitDescriptionController) GetKeybindings(opts types.KeybindingsOp
Key: opts.GetKey(opts.Config.Universal.Return),
Handler: self.close,
},
{
Key: opts.GetKey(opts.Config.Universal.ReturnAlt),
Handler: self.close,
},
{
Key: opts.GetKey(opts.Config.Universal.ConfirmInEditor),
Handler: self.confirm,
Expand Down
5 changes: 5 additions & 0 deletions pkg/gui/controllers/commit_message_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ func (self *CommitMessageController) GetKeybindings(opts types.KeybindingsOpts)
Handler: self.close,
Description: self.c.Tr.Close,
},
{
Key: opts.GetKey(opts.Config.Universal.ReturnAlt),
Handler: self.close,
Description: self.c.Tr.Close,
},
{
Key: opts.GetKey(opts.Config.Universal.PrevItem),
Handler: self.handlePreviousCommit,
Expand Down
6 changes: 6 additions & 0 deletions pkg/gui/controllers/confirmation_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ func (self *ConfirmationController) GetKeybindings(opts types.KeybindingsOpts) [
Description: self.c.Tr.CloseCancel,
DisplayOnScreen: true,
},
{
Key: opts.GetKey(opts.Config.Universal.ReturnAlt),
Handler: func() error { return self.context().State.OnClose() },
Description: self.c.Tr.CloseCancel,
DisplayOnScreen: true,
},
{
Key: opts.GetKey(opts.Config.Universal.CopyToClipboard),
Handler: self.handleCopyToClipboard,
Expand Down
9 changes: 9 additions & 0 deletions pkg/gui/controllers/global_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@ func (self *GlobalController) GetKeybindings(opts types.KeybindingsOpts) []*type
GetDisabledReason: self.escapeEnabled,
DisplayOnScreen: true,
},
{
Key: opts.GetKey(opts.Config.Universal.ReturnAlt),
Modifier: gocui.ModNone,
Handler: self.escape,
Description: self.c.Tr.Cancel,
DescriptionFunc: self.escapeDescription,
GetDisabledReason: self.escapeEnabled,
DisplayOnScreen: true,
},
{
ViewName: "",
Key: opts.GetKey(opts.Config.Universal.OptionMenu),
Expand Down
6 changes: 6 additions & 0 deletions pkg/gui/controllers/main_view_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ func (self *MainViewController) GetKeybindings(opts types.KeybindingsOpts) []*ty
Description: self.c.Tr.ExitFocusedMainView,
DisplayOnScreen: true,
},
{
Key: opts.GetKey(opts.Config.Universal.ReturnAlt),
Handler: self.escape,
Description: self.c.Tr.ExitFocusedMainView,
DisplayOnScreen: true,
},
{
// overriding this because we want to read all of the task's output before we start searching
Key: opts.GetKey(opts.Config.Universal.StartSearch),
Expand Down
6 changes: 6 additions & 0 deletions pkg/gui/controllers/menu_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ func (self *MenuController) GetKeybindings(opts types.KeybindingsOpts) []*types.
Description: self.c.Tr.CloseCancel,
DisplayOnScreen: true,
},
{
Key: opts.GetKey(opts.Config.Universal.ReturnAlt),
Handler: self.close,
Description: self.c.Tr.CloseCancel,
DisplayOnScreen: true,
},
}

return bindings
Expand Down
5 changes: 5 additions & 0 deletions pkg/gui/controllers/merge_conflicts_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ func (self *MergeConflictsController) GetKeybindings(opts types.KeybindingsOpts)
Handler: self.Escape,
Description: self.c.Tr.ReturnToFilesPanel,
},
{
Key: opts.GetKey(opts.Config.Universal.ReturnAlt),
Handler: self.Escape,
Description: self.c.Tr.ReturnToFilesPanel,
},
}

return bindings
Expand Down
7 changes: 7 additions & 0 deletions pkg/gui/controllers/patch_building_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ func (self *PatchBuildingController) GetKeybindings(opts types.KeybindingsOpts)
DescriptionFunc: self.EscapeDescription,
DisplayOnScreen: true,
},
{
Key: opts.GetKey(opts.Config.Universal.ReturnAlt),
Handler: self.Escape,
Description: self.c.Tr.ExitCustomPatchBuilder,
DescriptionFunc: self.EscapeDescription,
DisplayOnScreen: true,
},
}
}

Expand Down
6 changes: 6 additions & 0 deletions pkg/gui/controllers/prompt_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ func (self *PromptController) GetKeybindings(opts types.KeybindingsOpts) []*type
Description: self.c.Tr.CloseCancel,
DisplayOnScreen: true,
},
{
Key: opts.GetKey(opts.Config.Universal.ReturnAlt),
Handler: func() error { return self.context().State.OnClose() },
Description: self.c.Tr.CloseCancel,
DisplayOnScreen: true,
},
{
Key: opts.GetKey(opts.Config.Universal.TogglePanel),
Handler: func() error {
Expand Down
5 changes: 5 additions & 0 deletions pkg/gui/controllers/search_prompt_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ func (self *SearchPromptController) GetKeybindings(opts types.KeybindingsOpts) [
Modifier: gocui.ModNone,
Handler: self.cancel,
},
{
Key: opts.GetKey(opts.Config.Universal.ReturnAlt),
Modifier: gocui.ModNone,
Handler: self.cancel,
},
{
Key: opts.GetKey(opts.Config.Universal.PrevItem),
Modifier: gocui.ModNone,
Expand Down
4 changes: 4 additions & 0 deletions pkg/gui/controllers/snake_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ func (self *SnakeController) GetKeybindings(opts types.KeybindingsOpts) []*types
Key: opts.GetKey(opts.Config.Universal.Return),
Handler: self.Escape,
},
{
Key: opts.GetKey(opts.Config.Universal.ReturnAlt),
Handler: self.Escape,
},
}

return bindings
Expand Down
7 changes: 7 additions & 0 deletions pkg/gui/controllers/staging_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ func (self *StagingController) GetKeybindings(opts types.KeybindingsOpts) []*typ
DescriptionFunc: self.EscapeDescription,
DisplayOnScreen: true,
},
{
Key: opts.GetKey(opts.Config.Universal.ReturnAlt),
Handler: self.Escape,
Description: self.c.Tr.ReturnToFilesPanel,
DescriptionFunc: self.EscapeDescription,
DisplayOnScreen: true,
},
{
Key: opts.GetKey(opts.Config.Universal.TogglePanel),
Handler: self.TogglePanel,
Expand Down
4 changes: 4 additions & 0 deletions pkg/gui/controllers/suggestions_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ func (self *SuggestionsController) GetKeybindings(opts types.KeybindingsOpts) []
Key: opts.GetKey(opts.Config.Universal.Return),
Handler: func() error { return self.context().State.OnClose() },
},
{
Key: opts.GetKey(opts.Config.Universal.ReturnAlt),
Handler: func() error { return self.context().State.OnClose() },
},
{
Key: opts.GetKey(opts.Config.Universal.TogglePanel),
Handler: self.switchToPrompt,
Expand Down
4 changes: 4 additions & 0 deletions schema-master/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -1289,6 +1289,10 @@
"type": "string",
"default": "\u003cesc\u003e"
},
"return-alt": {
"type": "string",
"default": ""
},
"quitWithoutChangingDirectory": {
"type": "string",
"default": "Q"
Expand Down
4 changes: 4 additions & 0 deletions schema/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -1289,6 +1289,10 @@
"type": "string",
"default": "\u003cesc\u003e"
},
"return-alt": {
"type": "string",
"default": ""
},
"quitWithoutChangingDirectory": {
"type": "string",
"default": "Q"
Expand Down