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

Method selectPrevious

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

Source from the content-addressed store, hash-verified

505}
506
507func (sb *showBug) selectPrevious(g *gocui.Gui, v *gocui.View) error {
508 var selectable []string
509 if sb.isOnSide {
510 selectable = sb.sideSelectableView
511 } else {
512 selectable = sb.mainSelectableView
513 }
514
515 for i, name := range selectable {
516 if name == sb.selected {
517 // special case to scroll up to the top
518 if i == 0 {
519 sb.scroll = 0
520 }
521
522 sb.selected = selectable[maxInt(i-1, 0)]
523 return sb.focusView(g)
524 }
525 }
526
527 if sb.selected == "" && len(selectable) > 0 {
528 sb.selected = selectable[0]
529 }
530
531 return sb.focusView(g)
532}
533
534func (sb *showBug) selectNext(g *gocui.Gui, v *gocui.View) error {
535 var selectable []string

Callers

nothing calls this directly

Calls 2

focusViewMethod · 0.95
maxIntFunction · 0.85

Tested by

no test coverage detected