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

package focus

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

Index

Package Files

doc.go focus.go projecter.go

type Binder Uses

type Binder interface {
    Push(...bind.Bindable)
    Pop() []bind.Bindable
    Execute(bind.Bindable)
}

A Binder is a type which can bind bindables

type EditorOpener Uses

type EditorOpener interface {
    Open(string) (editor input.Editor, existed bool)
    CurrentEditor() input.Editor
}

EditorOpener represents a type that can open a file, returning an editor.

type FileBinder Uses

type FileBinder interface {
    // FileBindables returns the bindables that should be registered
    // for the given file.
    FileBindables(path string) []bind.Bindable
}

A FileBinder is a type that registers a list of commands on file open.

type FileChanger Uses

type FileChanger interface {
    // FileChanged will be called when the currently focused
    // file changes.
    FileChanged(oldPath, newPath string)
}

A FileChanger is a type that just needs to be called when the open file changes.

type LineStarter Uses

type LineStarter interface {
    LineStart(int) int
}

LineStarter represents a type that knows which position lines start at.

type Location Uses

type Location struct {
    status.General
    // contains filtered or unexported fields
}

Location is a bind.MultiOp that knows how to focus locations in the code.

func NewLocation Uses

func NewLocation(driver gxui.Driver) *Location

NewLocation returns a *Location bound to the passed in driver.

func (*Location) Bind Uses

func (l *Location) Bind(h bind.Bindable) (bind.HookedMultiOp, error)

Bind binds hooks to l.

func (*Location) Exec Uses

func (l *Location) Exec() error

Exec executes l against the values it has stored, returning an error if it encounters any problems.

func (*Location) For Uses

func (l *Location) For(opts ...Opt) bind.Bindable

For makes a clone of l, then applies opts to the copy before returning it.

func (*Location) Name Uses

func (l *Location) Name() string

Name returns l's name.

func (*Location) Reset Uses

func (l *Location) Reset()

Reset resets l's execution state.

func (*Location) Store Uses

func (l *Location) Store(elem interface{}) bind.Status

Store checks elem for an types that l needs to store in order to execute.

type Mover Uses

type Mover interface {
    To(...int) bind.Bindable
}

Mover represents a type that can move carets.

type Opener Uses

type Opener interface {
    Open(string)
}

Opener represents a type that can open a file, but doesn't return anything.

This is legacy code from before hooks existed and should be removed when all places that currently use it are converted to using hooks.

type Opt Uses

type Opt func(*Location) error

Opt is an option function that will apply to *Location types.

func Column Uses

func Column(col int) Opt

Column takes a column number and returns an Opt that will modify a *Location to move carets to that column. Compatible with Line.

func Line Uses

func Line(line int) Opt

Line takes a line number and returns an Opt that will modify a *Location to move carets to that line. Compatible with Column.

func Offset Uses

func Offset(offset int) Opt

Offset takes a character offset and returns an Opt that will modify a *Location to move carets to that offset.

func Path Uses

func Path(path string) Opt

Path takes a file path and returns an Opt that will modify a *Location to focus that file.

func SkipUnbind Uses

func SkipUnbind() Opt

SkipUnbind returns an Opt that modifies a *Location to skip the process of unbinding previously-bound commands. This is currently used to work around an issue that would leave the editor with *no* commands bound to it, as the final entry got popped ofl.

Package focus imports 6 packages (graph) and is imported by 6 packages. Updated 2018-10-31. Refresh now. Tools for package owners.