Documentation
¶
Index ¶
- type Buffer
- func (buf *Buffer) AppendString(row int, s string) (Position, error)
- func (buf *Buffer) GetLineAt(row int) *Line
- func (buf *Buffer) GetLineCount() int
- func (buf *Buffer) Init()
- func (buf *Buffer) InsertLine(row int, column int) *Line
- func (buf *Buffer) InsertString(row int, column int, s string) (Position, error)
- func (buf *Buffer) PrependString(row int, s string) (Position, error)
- func (buf *Buffer) RemoveLine(row int)
- func (buf *Buffer) RemoveString(row int, column int, length int)
- type Document
- func (doc *Document) FindNext(searchStr string) bool
- func (doc *Document) FindPrev(searchStr string) bool
- func (doc *Document) GetBuffer() *Buffer
- func (doc *Document) GetCursorColumn() int
- func (doc *Document) GetCursorRow() int
- func (doc *Document) Init()
- func (doc *Document) InsertLine()
- func (doc *Document) InsertString(s string)
- func (doc *Document) MoveDown()
- func (doc *Document) MoveLeft()
- func (doc *Document) MoveReset()
- func (doc *Document) MoveRight()
- func (doc *Document) MoveUp()
- func (doc *Document) RemoveChar()
- func (doc *Document) Replace(deleteCount int, replaceStr string) bool
- type Line
- type Position
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) AppendString ¶
AppendString is appending string into tail.
func (*Buffer) GetLineCount ¶
GetLineCount returns count of lines.
func (*Buffer) InsertLine ¶
InsertLine is break line at specified position.
func (*Buffer) InsertString ¶
InsertString is insert string into specified position.
func (*Buffer) PrependString ¶
PrependString is insert string into specified line ahead.
func (*Buffer) RemoveLine ¶
RemoveLine is remove specified line.
type Document ¶
type Document struct {
// contains filtered or unexported fields
}
Document is wrapper of Buffer. track a current cursor position.
func (*Document) FindNext ¶
FindNext is searches for the specified string forward from the current cursor position and moves the cursor to the beginning of the found string. Returns true if found, false otherwise.
func (*Document) FindPrev ¶
FindPrev is searches for the specified string backward from the current cursor position and moves the cursor to the beginning of the found string. Returns true if found, false otherwise.
func (*Document) GetCursorColumn ¶
GetCursorColumn returns column of cursor.
func (*Document) GetCursorRow ¶
GetCursorRow returns row of cursor.
func (*Document) InsertLine ¶
func (doc *Document) InsertLine()
InsertLine is break line at current cursor position.
func (*Document) InsertString ¶
InsertString is insert string at current cursor position.
func (*Document) MoveReset ¶
func (doc *Document) MoveReset()
MoveReset is cursor position reset to zero.
func (*Document) RemoveChar ¶
func (doc *Document) RemoveChar()
RemoveChar is remove character at current cursor position.
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.