From 3ca1fff7554f9dc19c0dd2523e034cc93cc4f91c Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Thu, 13 Feb 2025 22:54:57 -0600 Subject: [PATCH] mouse scroll in stdout --- eventBindings.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/eventBindings.go b/eventBindings.go index 02f33a6..05d1442 100644 --- a/eventBindings.go +++ b/eventBindings.go @@ -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 }