commands.go
1package tui
2
3import (
4 tea "github.com/charmbracelet/bubbletea"
5)
6
7type windowMsg struct{}
8
9func (m *Model) windowChangesCmd() tea.Msg {
10 w := <-m.windowChanges
11 m.width = w.Width
12 m.height = w.Height
13 return windowMsg{}
14}
15
16func (m *Model) getCommitsCmd() tea.Msg {
17 m.commits = m.repos.getCommits(20)
18 m.state = commitsLoadedState
19 return nil
20}