Documentation
¶
Overview ¶
Package logbuf holds the log line store with its selection state. It has no rendering dependencies so its logic is testable headless; the ui package draws it.
Index ¶
- type Buffer
- func (b *Buffer) Append(line string)
- func (b *Buffer) ClearSelection()
- func (b *Buffer) DragTo(id uint64, col int)
- func (b *Buffer) FirstID() uint64
- func (b *Buffer) HasSelection() bool
- func (b *Buffer) Line(id uint64) string
- func (b *Buffer) LineCount() int
- func (b *Buffer) MaxCols() int
- func (b *Buffer) SelSpan(id uint64) (int, int, bool)
- func (b *Buffer) SelectedText() string
- func (b *Buffer) StartSelection(id uint64, col int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
Buffer is the log line store with its selection. It lives for the application lifetime while the widgets rendering it come and go with UI rebuilds. Lines carry monotonic IDs (firstID + index) so the selection stays put when appends trim the front of the buffer.
func (*Buffer) Append ¶
Append adds one line and trims the front past the cap. A selection whose lines are trimmed away shrinks with them.
func (*Buffer) ClearSelection ¶
func (b *Buffer) ClearSelection()
ClearSelection drops the selection.
func (*Buffer) HasSelection ¶
HasSelection reports whether a selection exists.
func (*Buffer) SelSpan ¶
SelSpan returns the selected column range of one line, inclusive, and whether the line intersects the selection at all.
func (*Buffer) SelectedText ¶
SelectedText renders the selection as plain text with newlines. Lines are stored in full, so clipped display never truncates a copy.
func (*Buffer) StartSelection ¶
StartSelection anchors a new selection at one character.