Documentation ¶
Index ¶
- Variables
- type Buffers
- func (reg *Buffers) Active() []rune
- func (reg *Buffers) Complete() completion.Values
- func (reg *Buffers) EditBuffer(buf []rune, filename, filetype string, emacs bool) ([]rune, error)
- func (reg *Buffers) Get(register rune) []rune
- func (reg *Buffers) GetKill() []rune
- func (reg *Buffers) IsSelected() (name string, selected bool)
- func (reg *Buffers) Pop() []rune
- func (reg *Buffers) Reset()
- func (reg *Buffers) SetActive(register rune)
- func (reg *Buffers) Write(content ...rune)
- func (reg *Buffers) WriteTo(register rune, content ...rune)
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNoTempDirectory indicates that Go's standard os.TempDir() did not return a directory. ErrNoTempDirectory = errors.New("could not identify the temp directory on this system") // ErrWrite indicates that we failed to write the buffer to the file. ErrWrite = errors.New("failed to write buffer to file") // ErrCreate indicates that we failed to create the temp buffer file. ErrCreate = errors.New("failed to create buffer file") // ErrOpen indicates that we failed to open the buffer file. ErrOpen = errors.New("failed to open buffer file") // ErrRemove indicates that we failed to delete the buffer file. ErrRemove = errors.New("failed to remove buffer file") // ErrRead indicates that we failed to read the buffer file's content. ErrRead = errors.New("failed to read buffer file") )
var ErrStart = errors.New("failed to start editor")
ErrStart indicates that the command to start the editor failed.
Functions ¶
This section is empty.
Types ¶
type Buffers ¶
type Buffers struct {
// contains filtered or unexported fields
}
Buffers is a list of registers in which to put yanked/cut contents. These buffers technically are Vim registers with full functionality.
func NewBuffers ¶
func NewBuffers() *Buffers
NewBuffers is a required constructor to set up all the buffers/registers for the shell, because it contains maps that must be correctly initialized.
func (*Buffers) Active ¶
Active returns the contents of the active buffer/register (or the kill buffer if no active register is active), and resets the active register.
func (*Buffers) Complete ¶
func (reg *Buffers) Complete() completion.Values
Complete returns the contents of all buffers as a structured list of completions.
func (*Buffers) EditBuffer ¶
EditBuffer starts the system editor and opens the given buffer in it. If the filename is specified, the file will be created in the system temp directory under this name. If the filetype is not empty and if the system editor supports it, the file will be opened with the specified filetype passed to the editor.
func (*Buffers) Get ¶
Get returns the contents of a given register. If the rune is nil (rune(0)), it returns the value of the kill buffer (the " Vim register). If the rune is an alphanumeric comprised in the valid register IDs, their content is returned. If the register name is invalid, the function returns an empty rune slice.
func (*Buffers) IsSelected ¶
IsSelected returns the name of the selected register, and true if one is indeed selected, or the default one and false.
func (*Buffers) Reset ¶
func (reg *Buffers) Reset()
Reset forgets any active/pending buffer/register, but does not delete its contents.
func (*Buffers) SetActive ¶
SetActive sets the currently active register/buffer. Valid values are letters (lower/upper), digits (1-9), or read-only buffers ( . % : ).