Skip to content

Commit d8cb1d2

Browse files
committed
Rename KeepConfirmKeybindings to KeepConflictingKeybindings
After the change in the previous commit this expresses better what it is about.
1 parent 9e85017 commit d8cb1d2

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

pkg/gui/controllers/options_menu_action.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ func (self *OptionsMenuAction) Call() error {
4646
appendBindings(navigation, &types.MenuSection{Title: self.c.Tr.KeybindingsMenuSectionNavigation, Column: 1})
4747

4848
return self.c.Menu(types.CreateMenuOptions{
49-
Title: self.c.Tr.Keybindings,
50-
Items: menuItems,
51-
HideCancel: true,
52-
ColumnAlignment: []utils.Alignment{utils.AlignRight, utils.AlignLeft},
53-
AllowFilteringKeybindings: true,
54-
KeepConfirmKeybindings: true,
49+
Title: self.c.Tr.Keybindings,
50+
Items: menuItems,
51+
HideCancel: true,
52+
ColumnAlignment: []utils.Alignment{utils.AlignRight, utils.AlignLeft},
53+
AllowFilteringKeybindings: true,
54+
KeepConflictingKeybindings: true,
5555
})
5656
}
5757

pkg/gui/menu_panel.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func (gui *Gui) createMenu(opts types.CreateMenuOptions) error {
4242
maxColumnSize = max(maxColumnSize, len(item.LabelColumns))
4343

4444
// Remove all item keybindings that are the same as one of the essential bindings
45-
if !opts.KeepConfirmKeybindings && lo.Contains(essentialKeys, item.Key) {
45+
if !opts.KeepConflictingKeybindings && lo.Contains(essentialKeys, item.Key) {
4646
item.Key = nil
4747
}
4848
}

pkg/gui/types/common.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -150,13 +150,13 @@ const (
150150
)
151151

152152
type CreateMenuOptions struct {
153-
Title string
154-
Prompt string // a message that will be displayed above the menu options
155-
Items []*MenuItem
156-
HideCancel bool
157-
ColumnAlignment []utils.Alignment
158-
AllowFilteringKeybindings bool
159-
KeepConfirmKeybindings bool // if true, the keybindings that match the confirm binding will not be removed from menu items
153+
Title string
154+
Prompt string // a message that will be displayed above the menu options
155+
Items []*MenuItem
156+
HideCancel bool
157+
ColumnAlignment []utils.Alignment
158+
AllowFilteringKeybindings bool
159+
KeepConflictingKeybindings bool // if true, the keybindings that match essential bindings such as confirm or return will not be removed from menu items
160160
}
161161

162162
type CreatePopupPanelOpts struct {

0 commit comments

Comments
 (0)