Documentation
¶
Index ¶
- type Background
- type Border
- type Decoration
- type DecorationTree
- func (d *DecorationTree) Insert(decos ...Decoration)
- func (d *DecorationTree) Query(pos int) []Decoration
- func (d *DecorationTree) QueryRange(start, end int) []Decoration
- func (d *DecorationTree) RemoveAll()
- func (d *DecorationTree) RemoveBySource(source string) error
- func (t *DecorationTree) Split(line *layout.Line, runs *[]painter.RenderRun)
- type Squiggle
- type Strikethrough
- type Underline
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Background ¶
type Decoration ¶
type Decoration struct {
// Source marks where the decoration is from.
Source any
// Priority configures the painting order of the decoration.
// TODO.
Priority int
// Start and End are rune offset in the document.
Start, End int
Background *Background
Underline *Underline
Squiggle *Squiggle
Strikethrough *Strikethrough
Border *Border
Italic bool
Bold bool
}
Decoration defines APIs each concrete decorations should implement. A decoration represents styles sharing between a range of text.
type DecorationTree ¶
type DecorationTree struct {
// contains filtered or unexported fields
}
DecorationTree leverages a interval tree to stores overlapping decorations.
func NewDecorationTree ¶
func NewDecorationTree() *DecorationTree
func (*DecorationTree) Insert ¶
func (d *DecorationTree) Insert(decos ...Decoration)
Insert a new decoration range. start and end are offset in rune in the document.
func (*DecorationTree) Query ¶
func (d *DecorationTree) Query(pos int) []Decoration
Query returns all styles at a given character offset
func (*DecorationTree) QueryRange ¶
func (d *DecorationTree) QueryRange(start, end int) []Decoration
QueryRange returns all segments overlapping the range
func (*DecorationTree) RemoveAll ¶
func (d *DecorationTree) RemoveAll()
func (*DecorationTree) RemoveBySource ¶
func (d *DecorationTree) RemoveBySource(source string) error
type Strikethrough ¶
Click to show internal directories.
Click to hide internal directories.