Documentation ¶
Index ¶
- type Buffer
- func (buffer *Buffer) Append(line ...Line)
- func (buffer *Buffer) DeepDup() Buffer
- func (buffer *Buffer) DeleteRow(row int)
- func (buffer *Buffer) Dup() Buffer
- func (buffer *Buffer) Equals(buffer2 *Buffer) bool
- func (buffer *Buffer) GetIndent() (string, bool)
- func (buffer *Buffer) GetRow(row int) Line
- func (buffer *Buffer) InclSlice(row1, row2 int) *Buffer
- func (buffer *Buffer) InsertAfter(row int, lines ...Line)
- func (buffer *Buffer) Length() int
- func (buffer *Buffer) Lines() []Line
- func (buffer *Buffer) ReplaceBuffer(newBuffer Buffer)
- func (buffer *Buffer) ReplaceLine(line Line, row int)
- func (buffer *Buffer) ReplaceLines(lines []Line, minRow, maxRow int)
- func (buffer *Buffer) ReplaceWord(searchTerm, replaceTerm string, row, col int)
- func (buffer *Buffer) RowLength(row int) int
- func (buffer *Buffer) RowSlice(row, startCol, endCol int) Line
- func (buffer *Buffer) Search(searchTerm string, cursor cursor.Cursor, loop bool) (int, int, error)
- func (buffer *Buffer) SetRow(row int, line Line) error
- func (buffer *Buffer) StrSlab(row1, row2, col1, col2 int) []string
- func (buffer *Buffer) ToString(newline string) string
- type Line
- func (line *Line) Chars() []rune
- func (line Line) CommonStart(other Line) Line
- func (line Line) Dup() Line
- func (line *Line) GetChar(k int) rune
- func (line Line) Length() int
- func (line Line) RemoveTrailingWhitespace() Line
- func (line Line) Search(term string, start, end int) (int, int)
- func (line *Line) SetChar(k int, c rune) error
- func (line Line) Slice(startCol, endCol int) Line
- func (line Line) StrSlice(startCol, endCol int) string
- func (line Line) Tabs2spaces() Line
- func (line Line) ToString() string
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
}
func MakeBuffer ¶
func MakeSplitBuffer ¶
MakeSplitBuffer creates a buffer from a long string by splitting the string at a certain length.
func (*Buffer) InsertAfter ¶
func (*Buffer) ReplaceBuffer ¶
ReplaceBuffer replaces the content (lines) with the content from another buffer.
func (*Buffer) ReplaceLine ¶
func (*Buffer) ReplaceLines ¶
ReplaceLines replaces the lines from minRow to maxRow with lines.
func (*Buffer) ReplaceWord ¶
Replace replaces occurances of a string within a line.
type Line ¶
type Line struct {
// contains filtered or unexported fields
}
func (Line) CommonStart ¶
CommonStart returns the sub-line that is common between two lines.
func (Line) RemoveTrailingWhitespace ¶
func (Line) Search ¶
Search returns the start/end positions for a search term. A -1 indicates no match.
func (Line) Tabs2spaces ¶
Click to show internal directories.
Click to hide internal directories.