Semantic diff
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: mouse/trackpad scroll support

+16 -1
+16 -1
main.go
··· 114 114 m.height = 1 115 115 } 116 116 m.scrollToCursor() 117 + case tea.MouseMsg: 118 + switch msg.Button { 119 + case tea.MouseButtonWheelDown: 120 + m.cursor++ 121 + if m.cursor >= len(m.lines) { 122 + m.cursor = len(m.lines) - 1 123 + } 124 + m.scrollToCursor() 125 + case tea.MouseButtonWheelUp: 126 + m.cursor-- 127 + if m.cursor < 0 { 128 + m.cursor = 0 129 + } 130 + m.scrollToCursor() 131 + } 117 132 case tea.KeyMsg: 118 133 m.message = "" 119 134 switch msg.String() { ··· 567 582 return 568 583 } 569 584 570 - p := tea.NewProgram(m, tea.WithAltScreen()) 585 + p := tea.NewProgram(m, tea.WithAltScreen(), tea.WithMouseCellMotion()) 571 586 if _, err := p.Run(); err != nil { 572 587 fmt.Fprintln(os.Stderr, err) 573 588 os.Exit(1)