MCPcopy Create free account
hub / github.com/B33pBeeps/redthread / Cycle

Method Cycle

internal/app/notes.go:398–417  ·  view source on GitHub ↗
(direction int)

Source from the content-addressed store, hash-verified

396func (b *Board) Select(id string) { b.Selected = id }
397
398func (b *Board) Cycle(direction int) {
399 if len(b.Notes) == 0 {
400 return
401 }
402 idx := -1
403 for i, n := range b.Notes {
404 if n.ID == b.Selected {
405 idx = i
406 break
407 }
408 }
409 idx += direction
410 if idx < 0 {
411 idx = len(b.Notes) - 1
412 }
413 if idx >= len(b.Notes) {
414 idx = 0
415 }
416 b.Selected = b.Notes[idx].ID
417}
418
419func (b *Board) HitTopmost(cx, cy int) int {
420 for i := len(b.Notes) - 1; i >= 0; i-- {

Callers 1

handleBoardKeyMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected