MCPcopy Create free account
hub / github.com/JanSmrcka/differ / updateList

Method updateList

internal/ui/log.go:81–103  ·  view source on GitHub ↗
(msg tea.KeyMsg)

Source from the content-addressed store, hash-verified

79}
80
81func (m LogModel) updateList(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
82 switch msg.String() {
83 case "q", "ctrl+c":
84 return m, tea.Quit
85 case "j", "down":
86 if m.cursor < len(m.commits)-1 {
87 m.cursor++
88 }
89 case "k", "up":
90 if m.cursor > 0 {
91 m.cursor--
92 }
93 case "g":
94 m.cursor = 0
95 case "G":
96 m.cursor = max(0, len(m.commits)-1)
97 case "enter":
98 if len(m.commits) > 0 {
99 return m, m.loadCommitDiff()
100 }
101 }
102 return m, nil
103}
104
105func (m LogModel) updateDiff(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
106 switch msg.String() {

Callers 1

UpdateMethod · 0.95

Calls 1

loadCommitDiffMethod · 0.95

Tested by

no test coverage detected