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

Method selectUp

internal/ui/chat/messages_list.go:928–946  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

926}
927
928func (ml *messagesList) selectUp() tview.Cmd {
929 messages := ml.messages
930 if len(messages) == 0 {
931 return nil
932 }
933
934 cursor := ml.Cursor()
935 switch {
936 case cursor == -1:
937 cursor = len(messages) - 1
938 case cursor > 0:
939 cursor--
940 case cursor == 0:
941 return ml.fetchOlderMessages()
942 }
943
944 ml.SetCursor(cursor)
945 return nil
946}
947
948func (ml *messagesList) selectDown() {
949 messages := ml.messages

Callers 1

UpdateMethod · 0.95

Calls 3

CursorMethod · 0.95
fetchOlderMessagesMethod · 0.95
SetCursorMethod · 0.95

Tested by

no test coverage detected