vidar: github.com/nelsam/vidar/command/caret Index | Files

package caret

import "github.com/nelsam/vidar/command/caret"

Index

Package Files

caret.go on_edit.go

Constants

const (
    Select Mod = 1 << iota
    Word
    Whitespace

    Line       = Word | Whitespace
    SelectWord = Select | Word
    SelectLine = Select | Line

    NoMod Mod = 0
)

type CaretHandler Uses

type CaretHandler interface {
    Carets() []int
    SetCarets(...int)
}

type Commander Uses

type Commander interface {
    Bindable(name string) bind.Bindable
    Execute(bind.Bindable)
}

type Controller Uses

type Controller interface {
    Carets() []int
    MoveUp()
    SelectUp()
    MoveDown()
    SelectDown()
    MoveLeft()
    SelectLeft()
    MoveLeftByWord()
    SelectLeftByWord()
    MoveRight()
    SelectRight()
    MoveRightByWord()
    SelectRightByWord()
    MoveEnd()
    SelectEnd()
    MoveHome()
    SelectHome()
}

type Direction Uses

type Direction int
const (
    // NoDirection means that there was no Direction used
    // to move the caret.  It does not necessarily mean
    // that it didn't move.
    NoDirection Direction = iota

    Up
    Down
    Left
    Right
)

type Mod Uses

type Mod int

type MovedHook Uses

type MovedHook interface {
    Moved(e input.Editor, carets []int)
}

MovedHook is a hook that needs to trigger after the carets have moved.

type Mover Uses

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

func (*Mover) Bind Uses

func (m *Mover) Bind(b bind.Bindable) (bind.HookedMultiOp, error)

func (*Mover) Exec Uses

func (m *Mover) Exec() error

func (*Mover) For Uses

func (m *Mover) For(dir Direction, mod Mod) bind.Bindable

func (*Mover) Name Uses

func (*Mover) Name() string

func (*Mover) Reset Uses

func (m *Mover) Reset()

func (*Mover) Store Uses

func (m *Mover) Store(elem interface{}) bind.Status

func (*Mover) To Uses

func (m *Mover) To(carets ...int) bind.Bindable

type MovingHook Uses

type MovingHook interface {
    Moving(e input.Editor, d Direction, m Mod, carets []int) (newD Direction, newM Mod, newCarets []int)
}

MovingHook is a hook that needs to trigger when the caret is moving. If d and/or carets need to be modified by the hook before carets actually move, the MovingHook can return a different direction and/or slice of carets.

type OnEdit Uses

type OnEdit struct {
    Commander Commander
}

func (*OnEdit) Applied Uses

func (o *OnEdit) Applied(e input.Editor, edits []input.Edit)

func (*OnEdit) Name Uses

func (o *OnEdit) Name() string

func (*OnEdit) OpName Uses

func (o *OnEdit) OpName() string

Package caret imports 3 packages (graph) and is imported by 2 packages. Updated 2018-05-15. Refresh now. Tools for package owners.