MCPcopy Index your code
hub / github.com/git-bug/git-bug / scrollDown

Method scrollDown

termui/show_bug.go:481–505  ·  view source on GitHub ↗
(g *gocui.Gui, v *gocui.View)

Source from the content-addressed store, hash-verified

479}
480
481func (sb *showBug) scrollDown(g *gocui.Gui, v *gocui.View) error {
482 _, maxY := v.Size()
483
484 lastViewName := sb.mainSelectableView[len(sb.mainSelectableView)-1]
485
486 lastView, err := g.View(lastViewName)
487 if err != nil {
488 return err
489 }
490
491 _, vMaxY := lastView.Size()
492
493 _, vy0, _, _, err := g.ViewPosition(lastViewName)
494 if err != nil {
495 return err
496 }
497
498 maxScroll := vy0 + sb.scroll + vMaxY - maxY
499
500 sb.scroll += maxY / 2
501
502 sb.scroll = minInt(sb.scroll, maxScroll)
503
504 return nil
505}
506
507func (sb *showBug) selectPrevious(g *gocui.Gui, v *gocui.View) error {
508 var selectable []string

Callers

nothing calls this directly

Calls 2

minIntFunction · 0.85
SizeMethod · 0.45

Tested by

no test coverage detected