Help us shape the future of Go! Take the 2026 Go Developer Survey

buffer

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 23, 2024 License: BSD-3-Clause Imports: 1 Imported by: 9

Documentation

Index

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 NewBuffer

func NewBuffer() Buffer

func NewBufferWithString

func NewBufferWithString(input string) Buffer

func (*Buffer) AddCharacter

func (buffer *Buffer) AddCharacter(character rune)

Adds a character to the current cursor position, advancing the cursor by 1

func (*Buffer) AddString

func (buffer *Buffer) AddString(input string)

Adds a string to the cursor position

func (*Buffer) AdvanceCursor

func (buffer *Buffer) AdvanceCursor(amount int)

func (*Buffer) AdvanceCursorByWord

func (buffer *Buffer) AdvanceCursorByWord(wordCount int)

Move the cursor forward by a word count, delineated by white space

func (*Buffer) Clear

func (buffer *Buffer) Clear()

func (*Buffer) ClearPrevious

func (buffer *Buffer) ClearPrevious()

func (*Buffer) GetPrefix

func (buffer *Buffer) GetPrefix() string

func (Buffer) IsEmpty

func (buffer Buffer) IsEmpty() bool

func (*Buffer) NewLineCount

func (buffer *Buffer) NewLineCount() int

func (Buffer) Output

func (buffer Buffer) Output() (string, int)

func (Buffer) OutputWithoutPrefix

func (buffer Buffer) OutputWithoutPrefix() (string, int)

func (Buffer) PreviousOutput

func (buffer Buffer) PreviousOutput() (string, int)

func (*Buffer) RemoveCharacter

func (buffer *Buffer) RemoveCharacter()

Removes the character before the current cursor position if a character exists and retreats the cursor by 1

func (*Buffer) RetreatCursor

func (buffer *Buffer) RetreatCursor(amount int)

func (*Buffer) RetreatCursorByWord

func (buffer *Buffer) RetreatCursorByWord(wordCount int)

Move the cursor backwards by a word count, delineated by white space

func (*Buffer) SetCurrentValues

func (buffer *Buffer) SetCurrentValues(input BufferValues) *Buffer

func (*Buffer) SetCursor

func (buffer *Buffer) SetCursor(position int) *Buffer

func (*Buffer) SetPrefix

func (buffer *Buffer) SetPrefix(input string) *Buffer

func (*Buffer) SetPreviousValues

func (buffer *Buffer) SetPreviousValues(input BufferValues) *Buffer

func (*Buffer) SetString

func (buffer *Buffer) SetString(input string) *Buffer

func (*Buffer) UpdatePrevious

func (buffer *Buffer) UpdatePrevious()

type BufferValues

type BufferValues struct {
	Prefix   string
	Value    string
	Position int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL