Help us shape the future of Go! Take the 2026 Go Developer Survey

textBlock

package
v0.0.0-...-978d0fb Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

type Model struct {
	// contains filtered or unexported fields
}

func New

func New(content string) *Model

func NewWithAlign

func NewWithAlign(content string, align enums.Alignment) *Model

func NewWithLevel

func NewWithLevel(content string, level enums.BlockLevel) *Model

func (*Model) Align

func (m *Model) Align() enums.Alignment

func (*Model) ApplyBoldToRange

func (m *Model) ApplyBoldToRange(start, end int)

ApplyBoldToRange toggles bold on the character range [start, end).

func (*Model) ApplyColorToRange

func (m *Model) ApplyColorToRange(start, end int, color string)

ApplyColorToRange sets the color on the character range [start, end). Pass "" to clear color on the range.

func (*Model) DecreaseLevel

func (m *Model) DecreaseLevel()

func (*Model) FocusAt

func (m *Model) FocusAt(x, _ int, width int, _ int) int

func (*Model) Handle

func (*Model) Height

func (m *Model) Height() int

func (*Model) IncreaseLevel

func (m *Model) IncreaseLevel()

func (*Model) IsBoldAt

func (m *Model) IsBoldAt(col int) bool

IsBoldAt reports whether the character at col is bold.

func (*Model) Len

func (m *Model) Len() int

func (*Model) MergeFrom

func (m *Model) MergeFrom(other interfaces.EditorBlock) int

func (*Model) Render

func (m *Model) Render(ctx contexts.BlockRenderContext) string

func (*Model) SetAlign

func (m *Model) SetAlign(align enums.Alignment)

func (*Model) SetLevel

func (m *Model) SetLevel(level enums.BlockLevel)

func (*Model) SetSpans

func (m *Model) SetSpans(spans []types.Span)

func (*Model) SetText

func (m *Model) SetText(text string)

func (*Model) Spans

func (m *Model) Spans() []types.Span

func (*Model) StyleName

func (m *Model) StyleName() string

func (*Model) Text

func (m *Model) Text() string

func (*Model) Value

Source Files

  • model.go
  • mouse.go
  • update.go
  • view.go

Jump to

Keyboard shortcuts

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