tree

package
v1.4.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const Default = "default"

Variables

This section is empty.

Functions

func Clamp

func Clamp(rows []Row, cursor, scroll, height int) (int, int)

func Point

func Point(rows []Row, scroll, height, top, y int) (cursor int, ok bool)

Point maps a screen line to a cursor position

func Selectable

func Selectable(rows []Row) []int

Types

type Data

type Data struct {
	Subs       []ipc.Sub
	Nodes      []ipc.Node
	Collapsed  map[string]bool
	Probing    map[domain.NodeRef]bool
	Refreshing map[string]bool
	Query      string
	Status     ipc.Status
	Live       bool
	Emoji      bool
	Spinner    string
}

func (Data) Groups

func (d Data) Groups() []Group

func (Data) Render

func (d Data) Render(r Row, selected bool, width int) string

func (Data) Rows

func (d Data) Rows() []Row

type Group

type Group struct {
	Sub   ipc.Sub
	Nodes []ipc.Node
}

type Kind

type Kind int
const (
	Header Kind = iota
	Node
	Gap
	Meta
)

type Row

type Row struct {
	Kind Kind
	Sub  ipc.Sub
	Node ipc.Node
}

func At

func At(rows []Row, cursor int) (Row, bool)

func (Row) Selectable

func (r Row) Selectable() bool

func (Row) SubID

func (r Row) SubID() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL