summaryrefslogtreecommitdiff
path: root/eventBindings.go
diff options
context:
space:
mode:
Diffstat (limited to 'eventBindings.go')
-rw-r--r--eventBindings.go28
1 files changed, 10 insertions, 18 deletions
diff --git a/eventBindings.go b/eventBindings.go
index eaf8d92..16d5549 100644
--- a/eventBindings.go
+++ b/eventBindings.go
@@ -5,7 +5,6 @@ package main
import (
"fmt"
- "slices"
"strings"
"syscall"
@@ -104,28 +103,20 @@ func theNotsure(g *gocui.Gui, v *gocui.View) error {
}
func stdoutPgup(g *gocui.Gui, v *gocui.View) error {
- me.stdout.pager = 0
- log.Info(fmt.Sprintf("try to page up in the stdout buffer here pager=%d len(%d)", me.stdout.pager, len(me.stdout.outputS)))
+ me.stdout.pager -= 40
+ if me.stdout.pager < 0 {
+ me.stdout.pager = 0
+ }
+ tk := me.stdout.tk
+ tk.refreshStdout()
return nil
}
func stdoutPgdn(g *gocui.Gui, v *gocui.View) error {
me.stdout.pager += 10
- log.Info(fmt.Sprintf("try to page down in the stdout buffer here pager=%d len(%d)", me.stdout.pager, len(me.stdout.outputS)))
- tk := me.stdout.tk
-
- if len(me.stdout.outputS) < me.stdout.h+me.stdout.pager {
- log.Info(fmt.Sprintf("buffer too small=%d len(%d)", me.stdout.pager, len(me.stdout.outputS)))
- return nil
- }
- var cur []string
- // chop off the last lines in the buffer
- chop := len(me.stdout.outputS) - (me.stdout.pager + me.stdout.h)
- cur = append(cur, me.stdout.outputS[chop:chop+me.stdout.h]...)
- slices.Reverse(cur)
- tk.v.Clear()
- fmt.Fprintln(tk.v, strings.Join(cur, "\n"))
+ tk := me.stdout.tk
+ tk.refreshStdout()
return nil
}
@@ -155,10 +146,11 @@ func tabCycleWindows(g *gocui.Gui, v *gocui.View) error {
}
func theStdout(g *gocui.Gui, v *gocui.View) error {
+ me.stdout.pager = 0
if me.stdout.outputOnTop {
if me.stdout.outputOffscreen {
me.stdout.outputOffscreen = false
- log.Info("set stdout off screen here")
+ log.Info(fmt.Sprintf("set stdout off screen pager=%d len(%d)", me.stdout.pager, len(me.stdout.outputS)))
relocateStdoutOffscreen()
return nil
} else {