Skip to content

Commit c8a0fe5

Browse files
committed
Add alternative Confirm and Return hotkeys for confirmation windows
1 parent 585ea36 commit c8a0fe5

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

docs/Config.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ keybinding:
155155
goInto: '<enter>'
156156
openRecentRepos: '<c-r>'
157157
confirm: '<enter>'
158+
# confirm-prompt: 'y' # confirm prompt messages (alternative to the 'confirm')
159+
# cancel-prompt: 'n' # close/abort prompt messages (alternative to the 'return')
158160
remove: 'd'
159161
new: 'n'
160162
edit: 'e'

pkg/config/user_config.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@ type KeybindingUniversalConfig struct {
173173
GoInto string `yaml:"goInto"`
174174
Confirm string `yaml:"confirm"`
175175
ConfirmInEditor string `yaml:"confirmInEditor"`
176+
ConfirmPrompt string `yaml:"confirm-prompt"`
177+
CancelPrompt string `yaml:"cancel-prompt"`
176178
Remove string `yaml:"remove"`
177179
New string `yaml:"new"`
178180
Edit string `yaml:"edit"`

pkg/gui/controllers/confirmation_controller.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ func (self *ConfirmationController) GetKeybindings(opts types.KeybindingsOpts) [
3535
Description: self.c.Tr.CloseCancel,
3636
Display: true,
3737
},
38+
{
39+
Key: opts.GetKey(opts.Config.Universal.ConfirmPrompt),
40+
Handler: func() error { return self.context().State.OnConfirm() },
41+
},
42+
{
43+
Key: opts.GetKey(opts.Config.Universal.CancelPrompt),
44+
Handler: func() error { return self.context().State.OnClose() },
45+
},
3846
{
3947
Key: opts.GetKey(opts.Config.Universal.TogglePanel),
4048
Handler: func() error {

0 commit comments

Comments
 (0)