Skip to content

Commit 00a1aa8

Browse files
committed
fixup! Allow to switch branches in Commit View
Stop assigning keys after the 9th branch
1 parent e27386a commit 00a1aa8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/gui/controllers/helpers/refs_helper.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,13 +291,17 @@ func (self *RefsHelper) CreateCheckoutMenu(commit *models.Commit) error {
291291

292292
if len(branches) > 0 {
293293
menuItems = append(menuItems, lo.Map(branches, func(branch *models.Branch, index int) *types.MenuItem {
294+
var key types.Key
295+
if index < 9 {
296+
key = rune(index + 1 + '0') // Convert 1-based index to key
297+
}
294298
return &types.MenuItem{
295299
LabelColumns: []string{self.c.Tr.Actions.CheckoutBranch, style.FgBlue.Sprint(branch.Name)},
296300
OnPress: func() error {
297301
self.c.LogAction(self.c.Tr.Actions.CheckoutBranch)
298302
return self.CheckoutRef(branch.RefName(), types.CheckoutRefOptions{})
299303
},
300-
Key: rune(index + 1 + '0'), // Convert 1-based index to key
304+
Key: key,
301305
}
302306
})...)
303307
} else {

0 commit comments

Comments
 (0)