elvish: github.com/elves/elvish/pkg/edit/highlight Index | Files

package highlight

import "github.com/elves/elvish/pkg/edit/highlight"

Package highlight provides an Elvish syntax highlighter.

Index

Package Files

highlight.go highlighter.go regions.go theme.go

Variables

var MaxBlockForLate = 10 * time.Millisecond

MaxBlockForLate specifies the maximum wait time to block for late results. It can be changed for test cases.

type Config Uses

type Config struct {
    Check      func(n *parse.Chunk) error
    HasCommand func(name string) bool
}

Config keeps configuration for highlighting code.

type Highlighter Uses

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

Highlighter is a code highlighter that can deliver results asynchronously.

func NewHighlighter Uses

func NewHighlighter(cfg Config) *Highlighter

func (*Highlighter) Get Uses

func (hl *Highlighter) Get(code string) (ui.Text, []error)

Get returns the highlighted code and static errors found in the code.

func (*Highlighter) LateUpdates Uses

func (hl *Highlighter) LateUpdates() <-chan struct{}

LateUpdates returns a channel for notifying late updates.

Package highlight imports 7 packages (graph) and is imported by 1 packages. Updated 2020-02-15. Refresh now. Tools for package owners.