Documentation
¶
Index ¶
- Variables
- func Intersect(r, s image.Rectangle) image.Rectangle
- func RectInset(r image.Rectangle, xn, yn int) image.Rectangle
- type Annotation
- type AnnotationGroup
- type ColorizeGroup
- type ColorizeOp
- type Decoration
- type DecorationGroup
- type DecorationKind
- type Drawer
- type RangeAlignment
- type SyntaxComment
- type TextDrawerOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var CursorHalfHit = false
View Source
var WrapLineIndentTabs = 0.0
View Source
var WrapLineRune = rune('←') // positioned at the start of wrapped line (left)
View Source
var WrapWordLimit = 0
Functions ¶
Types ¶
type Annotation ¶ added in v1.3.14
type AnnotationGroup ¶ added in v1.3.14
type AnnotationGroup struct {
sync.RWMutex
Anns []*Annotation
}
func NewAnnotationGroup ¶ added in v1.3.14
func NewAnnotationGroup(n int) *AnnotationGroup
func (*AnnotationGroup) On ¶ added in v1.3.14
func (ag *AnnotationGroup) On() bool
type ColorizeGroup ¶ added in v1.3.14
type ColorizeGroup struct {
Off bool
Ops []*ColorizeOp
}
type ColorizeOp ¶ added in v1.3.14
type Decoration ¶ added in v1.3.14
type Decoration struct {
Offset int
Kind DecorationKind
Fg color.Color
Thickness int
}
type DecorationGroup ¶ added in v1.3.14
type DecorationGroup struct {
Off bool
Entries []*Decoration
}
type DecorationKind ¶ added in v1.3.14
type DecorationKind uint8
const (
DecorationHorizontalRule DecorationKind = iota + 1
)
type Drawer ¶
type Drawer interface {
Reader() iorw.ReaderAt
SetReader(iorw.ReaderAt)
ContentChanged()
TextDrawerOptions() *TextDrawerOptions
TextDrawerOptionsChanged()
FontFace() *fontutil.FontFace
SetFontFace(*fontutil.FontFace)
LineHeight() int
SetFg(color.Color)
Bounds() image.Rectangle
SetBounds(image.Rectangle)
// rune offset (set text view position; save/restore view in session file)
RuneOffset() int
SetRuneOffset(int)
LocalPointOf(index int) image.Point
LocalIndexOf(image.Point) int
AnnotationsIndexOf(image.Point) (int, int, bool)
Measure() image.Point
Draw(img draw.Image)
// specialized: covers editor row button margin
FirstLineOffsetX() int
SetFirstLineOffsetX(x int)
// cursor
SetCursorOffset(int)
// scrollable utils
ScrollOffset() image.Point
SetScrollOffset(image.Point)
ScrollSize() image.Point
ScrollViewSize() image.Point
ScrollPageSizeY(up bool) int
ScrollWheelSizeY(up bool) int
// visibility utils
RangeVisible(offset, n int) bool
RangeVisibleOffset(offset, n int, align RangeAlignment) int
}
type RangeAlignment ¶ added in v1.3.8
type RangeAlignment int
const ( RAlignKeep RangeAlignment = iota RAlignKeepOrBottom // keep if visible, or bottom RAlignAuto RAlignTop RAlignBottom RAlignCenter )
type SyntaxComment ¶ added in v1.3.11
func (*SyntaxComment) IsLine ¶ added in v1.3.11
func (syc *SyntaxComment) IsLine() bool
type TextDrawerOptions ¶ added in v1.3.14
type TextDrawerOptions struct {
LineWrap struct {
On bool
Fg, Bg color.Color
}
Cursor struct {
On bool
Fg color.Color
AddedWidth int
}
IndexOf struct {
HalfHit bool
}
TextContrast struct {
On bool
Bg color.Color
}
Colorize struct {
Groups []*ColorizeGroup
}
Decorations struct {
Groups []*DecorationGroup
}
Annotations struct {
On bool
Fg, Bg color.Color
Selected struct {
EntryIndex int
Fg, Bg color.Color
}
Entries *AnnotationGroup // must be ordered by offset
}
WordHighlight struct {
On bool
Fg, Bg color.Color
Group ColorizeGroup
}
ParenthesisHighlight struct {
On bool
Fg, Bg color.Color
Group ColorizeGroup
}
ContentColorize struct {
Git struct {
On bool
AddFg color.Color
DeleteFg color.Color
}
Group ColorizeGroup
}
SyntaxHighlight struct {
On bool
Comment struct {
SCs []*SyntaxComment
Fg, Bg color.Color
}
String struct {
Fg, Bg color.Color
}
Group ColorizeGroup
}
}
Click to show internal directories.
Click to hide internal directories.