nav

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Actions

func Actions() []input.Action

Types

type Deselect

type Deselect struct{}

func NewDeselect

func NewDeselect() *Deselect

func (*Deselect) DefaultEvent

func (d *Deselect) DefaultEvent() string

func (*Deselect) Menu

func (d *Deselect) Menu(context.Context) string

func (*Deselect) Name

func (d *Deselect) Name(context.Context) string

func (*Deselect) Op

func (*Deselect) Type

func (d *Deselect) Type(input.Command)

func (*Deselect) Valid

func (d *Deselect) Valid(_ context.Context, b input.Binder) error

type End

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

func NewEnd

func NewEnd(mod caret.Modifier) *End

func (*End) DefaultEvent

func (h *End) DefaultEvent() string

func (*End) Menu

func (h *End) Menu(context.Context) string

func (*End) Name

func (h *End) Name(context.Context) string

func (*End) Op

func (h *End) Op(ctx context.Context, b input.Binder) (input.Operation, error)

func (*End) Type

func (h *End) Type(input.Command)

func (*End) Valid

func (h *End) Valid(_ context.Context, b input.Binder) error

type Home

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

func NewHome

func NewHome(mod caret.Modifier) *Home

func (*Home) DefaultEvent

func (h *Home) DefaultEvent() string

func (*Home) Menu

func (h *Home) Menu(context.Context) string

func (*Home) Name

func (h *Home) Name(context.Context) string

func (*Home) Op

func (h *Home) Op(ctx context.Context, b input.Binder) (input.Operation, error)

func (*Home) Type

func (h *Home) Type(input.Command)

func (*Home) Valid

func (h *Home) Valid(_ context.Context, b input.Binder) error

type MoveCaret

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

MoveCaret is a command to move carets.

func NewMoveCaret

func NewMoveCaret(dir caret.Direction, mod caret.Modifier) MoveCaret

NewMoveCaret returns a new MoveCaret command for the provided direction and modifier.

func (MoveCaret) DefaultEvent

func (m MoveCaret) DefaultEvent() string

func (MoveCaret) Menu

func (m MoveCaret) Menu(context.Context) string

Menu returns the menu that this action should be displayed under.

func (MoveCaret) Name

func (m MoveCaret) Name(context.Context) string

Name returns the name of this MoveCaret.

func (MoveCaret) Op

Op returns the input.Operation that should be used to execute this command.

func (MoveCaret) Type

func (m MoveCaret) Type(input.Command)

Type implements input.Command.

func (MoveCaret) Valid

func (m MoveCaret) Valid(_ context.Context, b input.Binder) error

Valid implements input.PickyAction.

type MoveOnEdit

type MoveOnEdit struct{}

func (MoveOnEdit) Name

func (m MoveOnEdit) Name(context.Context) string

func (MoveOnEdit) OpNames

func (m MoveOnEdit) OpNames(context.Context) []string

func (MoveOnEdit) TextJustChanged

func (m MoveOnEdit) TextJustChanged(ctx context.Context, b input.Binder, hist ...struct {
	Before text.State
	Edit   input.Edit
})

func (MoveOnEdit) Type

func (m MoveOnEdit) Type(input.Hook)

type PageDown

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

func NewPageDown

func NewPageDown(mod caret.Modifier) *PageDown

func (*PageDown) DefaultEvent

func (p *PageDown) DefaultEvent() string

func (*PageDown) Menu

func (p *PageDown) Menu(context.Context) string

func (*PageDown) Name

func (p *PageDown) Name(context.Context) string

func (*PageDown) Op

func (*PageDown) Type

func (p *PageDown) Type(input.Command)

func (*PageDown) Valid

func (p *PageDown) Valid(_ context.Context, b input.Binder) error

type PageStore

type PageStore interface {
	SelectionStore
	Visible(context.Context) ui.Range
}

type PageUp

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

func NewPageUp

func NewPageUp(mod caret.Modifier) *PageUp

func (*PageUp) DefaultEvent

func (p *PageUp) DefaultEvent() string

func (*PageUp) Menu

func (p *PageUp) Menu(context.Context) string

func (*PageUp) Name

func (p *PageUp) Name(context.Context) string

func (*PageUp) Op

func (*PageUp) Type

func (p *PageUp) Type(input.Command)

func (*PageUp) Valid

func (p *PageUp) Valid(_ context.Context, b input.Binder) error

type SelectionSetter

type SelectionSetter interface {
	input.Action
	Select(caret.Selection, ...caret.Selection) input.Operation
}

SelectionSetter represents an operation that can move selections.

type SelectionStore

type SelectionStore interface {
	input.Binder

	// Selections should return the currently applied list of caret.Selection
	// values.
	Selections(context.Context) (caret.Selection, []caret.Selection)

	State(context.Context) text.State
}

SelectionStore represents a type that tracks selections. It contains the information that the MoveCaret command needs in order to work properly.

Invalid pos values (e.g. negative numbers or numbers after the end of the file) should be treated as if they were constrained to valid values, e.g. -1 should be treated as 0, EOF+1 should be treated as EOF.

type SelectionViewer

type SelectionViewer interface {
	input.Binder
	Selections(context.Context) (caret.Selection, []caret.Selection)
}

Jump to

Keyboard shortcuts

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