hinters

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: May 10, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PriorityNone     = 0
	PriorityVeryLow  = 48
	PriorityLow      = 96
	PriorityMedium   = 128
	PriorityHigh     = 192
	PriorityVeryHigh = 224
	PriorityCritical = 255
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Base64Hinter

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

func (*Base64Hinter) Activate

func (h *Base64Hinter) Activate(api HintAPI, match string, start termutil.Position, end termutil.Position) error

func (*Base64Hinter) Click

func (h *Base64Hinter) Click(api HintAPI) error

func (*Base64Hinter) Deactivate

func (h *Base64Hinter) Deactivate(api HintAPI) error

func (*Base64Hinter) Match

func (h *Base64Hinter) Match(text string, cursorIndex int) (matched bool, offset int, length int)

type DmesgTimestampHinter

type DmesgTimestampHinter struct{}

func (*DmesgTimestampHinter) Activate

func (h *DmesgTimestampHinter) Activate(api HintAPI, match string, start termutil.Position, end termutil.Position) error

func (*DmesgTimestampHinter) Click

func (h *DmesgTimestampHinter) Click(api HintAPI) error

func (*DmesgTimestampHinter) Deactivate

func (h *DmesgTimestampHinter) Deactivate(api HintAPI) error

func (*DmesgTimestampHinter) Match

func (h *DmesgTimestampHinter) Match(text string, cursorIndex int) (matched bool, offset int, length int)

type HexColourHinter

type HexColourHinter struct {
}

func (*HexColourHinter) Activate

func (h *HexColourHinter) Activate(api HintAPI, match string, start termutil.Position, end termutil.Position) error

func (*HexColourHinter) Click

func (h *HexColourHinter) Click(api HintAPI) error

func (*HexColourHinter) Deactivate

func (h *HexColourHinter) Deactivate(api HintAPI) error

func (*HexColourHinter) Match

func (h *HexColourHinter) Match(text string, cursorIndex int) (matched bool, offset int, length int)

type HintAPI

type HintAPI interface {
	ShowMessage(msg string)
	SetCursorToPointer()
	ResetCursor()
	Highlight(start termutil.Position, end termutil.Position, label string, img image.Image)
	ClearHighlight()
	CellSize() image.Point
}

type Hinter

type Hinter interface {
	// Match should return the index in the text of the matched occurrence
	Match(text string, cursorIndex int) (matched bool, offset int, length int)
	// Activate fires when mouseover happens afer a match - takes raw coords
	Activate(api HintAPI, match string, start termutil.Position, end termutil.Position) error
	Deactivate(api HintAPI) error
	Click(api HintAPI) error
}

func All

func All() []Hinter

type HinterRegistration

type HinterRegistration struct {
	Priority Priority
	Hinter   Hinter
}

type PermsHinter

type PermsHinter struct {
}

func (*PermsHinter) Activate

func (h *PermsHinter) Activate(api HintAPI, match string, start termutil.Position, end termutil.Position) error

func (*PermsHinter) Click

func (h *PermsHinter) Click(api HintAPI) error

func (*PermsHinter) Deactivate

func (h *PermsHinter) Deactivate(api HintAPI) error

func (*PermsHinter) Match

func (h *PermsHinter) Match(text string, cursorIndex int) (matched bool, offset int, length int)

type Priority

type Priority uint8

type URLHinter

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

func (*URLHinter) Activate

func (h *URLHinter) Activate(api HintAPI, match string, start termutil.Position, end termutil.Position) error

func (*URLHinter) Click

func (h *URLHinter) Click(api HintAPI) error

func (*URLHinter) Deactivate

func (h *URLHinter) Deactivate(api HintAPI) error

func (*URLHinter) Match

func (h *URLHinter) Match(text string, cursorIndex int) (matched bool, offset int, length int)

Jump to

Keyboard shortcuts

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