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

package scroll

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

Index

Package Files

on_edit.go scroll.go

type Commander Uses

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

type Controller Uses

type Controller interface {
    ScrollToLine(int)
    ScrollToRune(int)
    SetScrollOffset(int)
    StartOffset() int
    LineIndex(int) int
}

Controller matches the type we need to control scrolling.

type Direction Uses

type Direction int
const (
    NoDirection Direction = iota

    Up
)

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

type Opt Uses

type Opt func(*Scroller) *Scroller

Opt is an option function to be passed to Scroller.For

func ToLine Uses

func ToLine(line int) Opt

ToLine is an Opt that sets s to scroll vertically, focusing on line. The horizontal position will not change.

func ToOldOffset Uses

func ToOldOffset() Opt

ToOldOffset is an Opt that sets scroll in the stored position

func ToRune Uses

func ToRune(pos int, dir Direction) Opt

ToRune is an Opt that sets s to scroll directly to a rune position.

type ScrolledHook Uses

type ScrolledHook interface {
    Scrolled(e input.Editor, focus int)
}

ScrolledHook is a hook that will trigger whenever the view has scrolled.

type Scroller Uses

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

Scroller is a bind.Op that is used to scroll the editor frame.

func (*Scroller) Bind Uses

func (s *Scroller) Bind(b bind.Bindable) (bind.HookedMultiOp, error)

Bind clones s, binds b as a hook to the clone, and returns it.

func (*Scroller) Exec Uses

func (s *Scroller) Exec() error

Exec executes s after it has stored all the values it needs.

func (*Scroller) For Uses

func (s *Scroller) For(opts ...Opt) bind.Bindable

For returns a copy of s (as a bind.Bindable for dependency reasons) which has had the passed in opts applied.

func (*Scroller) Name Uses

func (*Scroller) Name() string

Name returns Scroller's name.

func (*Scroller) Reset Uses

func (s *Scroller) Reset()

Reset resets the execution state of s.

func (*Scroller) Store Uses

func (s *Scroller) Store(elem interface{}) bind.Status

Store checks elem for the necessary methods and stores it if it's needed.

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