Skip to content

Commit 3fa9783

Browse files
committed
fix(custom_commands): make sure list is stable sorted
fixes #424
1 parent 742f639 commit 3fa9783

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

internal/ui/custom_commands/custom_commands.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,11 @@ func NewModel(ctx *context.MainContext) *Model {
143143
items = append(items, item{name: name, desc: desc, command: cmd, key: command.Binding(), keySequence: command.Sequence()})
144144
}
145145
}
146+
147+
sort.Slice(items, func(i, j int) bool {
148+
return items[i].(item).name < items[j].(item).name
149+
})
150+
146151
keyMap := config.Current.GetKeyMap()
147152
menu := menu.NewMenu(items, keyMap, menu.WithStylePrefix("custom_commands"))
148153
menu.Title = "Custom Commands"

0 commit comments

Comments
 (0)