mouse scroll in stdout

This commit is contained in:
Jeff Carr 2025-02-13 22:54:57 -06:00
parent 5a9f3565aa
commit 22cda9acdb
1 changed files with 12 additions and 2 deletions

View File

@ -106,12 +106,22 @@ func theDarkness(g *gocui.Gui, v *gocui.View) error {
}
func wheelsUp(g *gocui.Gui, v *gocui.View) error {
log.Info("private wheels up")
// log.Info("private wheels up")
me.stdout.pager -= 2
if me.stdout.pager < 0 {
me.stdout.pager = 0
}
me.stdout.tk.refreshStdout()
return nil
}
func wheelsDown(g *gocui.Gui, v *gocui.View) error {
log.Info("you've landed")
// log.Info("you've landed")
me.stdout.pager += 2
if me.stdout.pager > len(me.stdout.outputS) {
me.stdout.pager = len(me.stdout.outputS)
}
me.stdout.tk.refreshStdout()
return nil
}