Documentation
¶
Index ¶
- type Buffer
- func (buf *Buffer) CreateTrack(row int, bytePos int) *Track
- func (buf *Buffer) GetLineAt(row int) *Line
- func (buf *Buffer) GetLineCount() int
- func (buf *Buffer) Init()
- func (buf *Buffer) InsertString(row int, column int, s string) (Position, error)
- func (buf *Buffer) RemoveString(row int, column int, length int)
- func (buf *Buffer) RemoveTrack(track *Track)
- func (buf *Buffer) ReplaceAll(r io.Reader)
- type BufferSegment
- type Document
- type Element
- type FoldBlockElement
- type GhostElement
- type Line
- type PlainDocument
- func (doc *PlainDocument) Clear()
- func (doc *PlainDocument) CreateTrack(row int, bytePos int) *Track
- func (doc *PlainDocument) GetLineBytes(index int) int
- func (doc *PlainDocument) GetLineCount() int
- func (doc *PlainDocument) GetLineString(lineIndex int) string
- func (doc *PlainDocument) GetVersion() uint
- func (doc *PlainDocument) Init()
- func (doc *PlainDocument) InsertString(row int, bytePos int, s string)
- func (doc *PlainDocument) Read(r Range) Segment
- func (doc *PlainDocument) Remove(row int, bytePos int, byteLen int)
- func (doc *PlainDocument) Render() []Element
- func (doc *PlainDocument) ReplaceAll(r io.Reader)
- type PlainElement
- type Position
- type Range
- type Segment
- type Span
- type Track
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 array of line strings. Buffer API's require and returns unit of codepoint positions.
func (*Buffer) CreateTrack ¶ added in v0.3.0
CreateTrack creates a new position tracker.
func (*Buffer) GetLineCount ¶
GetLineCount returns count of lines.
func (*Buffer) InsertString ¶
InsertString is insert string into specified position.
func (*Buffer) RemoveString ¶
RemoveString is remove string specified range.
func (*Buffer) RemoveTrack ¶ added in v0.3.0
RemoveTrack removes a position tracker from the buffer.
func (*Buffer) ReplaceAll ¶ added in v0.3.0
type BufferSegment ¶ added in v0.3.0
type BufferSegment struct {
// contains filtered or unexported fields
}
func (BufferSegment) GetLine ¶ added in v0.3.0
func (bs BufferSegment) GetLine(lineIndex int) string
func (BufferSegment) GetLineCount ¶ added in v0.3.0
func (bs BufferSegment) GetLineCount() int
func (BufferSegment) GetSpan ¶ added in v0.3.0
func (bs BufferSegment) GetSpan(lineIndex int) Span
type FoldBlockElement ¶ added in v0.3.0
func (*FoldBlockElement) GetElement ¶ added in v0.3.0
func (f *FoldBlockElement) GetElement(index int) Element
func (*FoldBlockElement) GetElementCount ¶ added in v0.3.0
func (f *FoldBlockElement) GetElementCount() int
func (*FoldBlockElement) GetRange ¶ added in v0.3.0
func (f *FoldBlockElement) GetRange(index int) Range
func (*FoldBlockElement) GetRangeCount ¶ added in v0.3.0
func (f *FoldBlockElement) GetRangeCount() int
type GhostElement ¶ added in v0.3.0
func (*GhostElement) GetElement ¶ added in v0.3.0
func (g *GhostElement) GetElement(index int) Element
func (*GhostElement) GetElementCount ¶ added in v0.3.0
func (g *GhostElement) GetElementCount() int
func (*GhostElement) GetRange ¶ added in v0.3.0
func (g *GhostElement) GetRange(index int) Range
func (*GhostElement) GetRangeCount ¶ added in v0.3.0
func (g *GhostElement) GetRangeCount() int
type Line ¶
type Line struct {
// contains filtered or unexported fields
}
Line is parts of buffer.
func (*Line) AppendString ¶
AppendString is appending string into tail.
func (*Line) GetContent ¶
GetContent is returns string of content.
func (*Line) InsertString ¶
InsertString is insert string into specified column.
func (*Line) PrependString ¶
PrependString is insert string into line ahead.
type PlainDocument ¶ added in v0.3.0
type PlainDocument struct {
// contains filtered or unexported fields
}
PlainDocument is wrapper of Buffer. track a current cursor position.
func (*PlainDocument) Clear ¶ added in v0.3.0
func (doc *PlainDocument) Clear()
Clear is initialize Buffer.
func (*PlainDocument) CreateTrack ¶ added in v0.3.0
func (doc *PlainDocument) CreateTrack(row int, bytePos int) *Track
func (*PlainDocument) GetLineBytes ¶ added in v0.3.0
func (doc *PlainDocument) GetLineBytes(index int) int
func (*PlainDocument) GetLineCount ¶ added in v0.3.0
func (doc *PlainDocument) GetLineCount() int
func (*PlainDocument) GetLineString ¶ added in v0.3.0
func (doc *PlainDocument) GetLineString(lineIndex int) string
func (*PlainDocument) GetVersion ¶ added in v0.3.0
func (doc *PlainDocument) GetVersion() uint
func (*PlainDocument) Init ¶ added in v0.3.0
func (doc *PlainDocument) Init()
Init is initialize Buffer.
func (*PlainDocument) InsertString ¶ added in v0.3.0
func (doc *PlainDocument) InsertString(row int, bytePos int, s string)
func (*PlainDocument) Read ¶ added in v0.3.0
func (doc *PlainDocument) Read(r Range) Segment
func (*PlainDocument) Remove ¶ added in v0.3.0
func (doc *PlainDocument) Remove(row int, bytePos int, byteLen int)
func (*PlainDocument) Render ¶ added in v0.3.0
func (doc *PlainDocument) Render() []Element
func (*PlainDocument) ReplaceAll ¶ added in v0.3.0
func (doc *PlainDocument) ReplaceAll(r io.Reader)
type PlainElement ¶ added in v0.3.0
type PlainElement struct {
Range Range
}
func (*PlainElement) GetElement ¶ added in v0.3.0
func (p *PlainElement) GetElement(index int) Element
func (*PlainElement) GetElementCount ¶ added in v0.3.0
func (p *PlainElement) GetElementCount() int
func (*PlainElement) GetRange ¶ added in v0.3.0
func (p *PlainElement) GetRange(index int) Range
func (*PlainElement) GetRangeCount ¶ added in v0.3.0
func (p *PlainElement) GetRangeCount() int