text

package
v0.0.0-...-5a72617 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2016 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Buffer

type Buffer struct {
	Lines []*Line
	// contains filtered or unexported fields
}

func NewBuffer

func NewBuffer() *Buffer

func (*Buffer) AutoSelect

func (b *Buffer) AutoSelect(addr address.Simple) address.Selection

AutoSelect selects some text around a. Based on acme's double click selection rules.

func (*Buffer) ClearSel

func (b *Buffer) ClearSel(sel address.Selection) address.Selection

func (*Buffer) Contents

func (b *Buffer) Contents() []byte

func (*Buffer) Find

func (b *Buffer) Find(dot address.Simple, s string) (address.Selection, bool)

func (*Buffer) GetSel

func (b *Buffer) GetSel(sel address.Selection) string

func (*Buffer) InsertString

func (b *Buffer) InsertString(addr address.Simple, s string) address.Simple

InsertString inserts s into the buffer at a, adding new Lines if s contains newline characters.

func (*Buffer) JumpTo

func (b *Buffer) JumpTo(dot address.Simple, addr string) (address.Selection, bool)

func (*Buffer) LastAddress

func (b *Buffer) LastAddress() address.Simple

func (*Buffer) NextSimple

func (b *Buffer) NextSimple(a address.Simple) address.Simple

func (*Buffer) PrevSimple

func (b *Buffer) PrevSimple(a address.Simple) address.Simple

func (*Buffer) SelFunc

func (b *Buffer) SelFunc(addr address.Simple, sepFn func(sep rune) bool) address.Selection

SelFunc is analogous to strings.FieldsFunc, returning a selection specified by sepFn. SepFn should return true when sep is the desired separator.

func (*Buffer) SelLine

func (b *Buffer) SelLine(addr address.Simple) address.Selection

SelLine selects a line.

func (*Buffer) SelWord

func (b *Buffer) SelWord(addr address.Simple) address.Selection

SelWord selects a word. If we're on a non-alphanumeric, attempt to select a word to the left of the click; otherwise expand across alphanumerics in both directions.

type Line

type Line struct {
	// contains filtered or unexported fields
}

func (*Line) Bytes

func (l *Line) Bytes() []byte

Bytes returns the contents of l as a byte slice. The caller should take care not to modify the slice.

func (*Line) RuneCount

func (l *Line) RuneCount() int

func (*Line) String

func (l *Line) String() string

String returns the contents of l as a string.

Jump to

Keyboard shortcuts

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