MCPcopy
hub / github.com/ayn2op/discordo / newMentionsList

Function newMentionsList

internal/ui/chat/mentions_list.go:23–43  ·  view source on GitHub ↗
(cfg *config.Config)

Source from the content-addressed store, hash-verified

21}
22
23func newMentionsList(cfg *config.Config) *mentionsList {
24 m := &mentionsList{
25 Model: list.NewModel(),
26 }
27 m.SetSelectedStyle(tcell.StyleDefault.Reverse(true))
28 m.SetKeybinds(list.Keybinds{
29 SelectUp: cfg.Keybinds.MentionsList.SelectUp.Keybind,
30 SelectDown: cfg.Keybinds.MentionsList.SelectDown.Keybind,
31 SelectTop: cfg.Keybinds.MentionsList.SelectTop.Keybind,
32 SelectBottom: cfg.Keybinds.MentionsList.SelectBottom.Keybind,
33 })
34
35 m.Box = ui.ConfigureBox(m.Box, &cfg.Theme)
36 m.SetSnapToItems(true).SetTitle("Mentions")
37
38 b := m.BorderSet()
39 b.BottomLeft, b.BottomRight = b.BottomT, b.BottomT
40 m.SetBorderSet(b)
41
42 return m
43}
44
45func (m *mentionsList) append(item mentionsListItem) {
46 m.items = append(m.items, item)

Callers 1

newComposerFunction · 0.85

Calls 2

ConfigureBoxFunction · 0.92
SetTitleMethod · 0.80

Tested by

no test coverage detected