app

package
v0.0.0-...-1060007 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CompareKeys = CompareKeysMap{
	Up: key.NewBinding(
		key.WithKeys("up"),
		key.WithHelp("↑", "up"),
	),
	Down: key.NewBinding(
		key.WithKeys("down"),
		key.WithHelp("↓", "down"),
	),
	Top: key.NewBinding(
		key.WithKeys("shift+up"),
		key.WithHelp("shift+↑", "top"),
	),
	Bottom: key.NewBinding(
		key.WithKeys("shift+down"),
		key.WithHelp("shift+↓", "bottom"),
	),
	Accept: key.NewBinding(
		key.WithKeys("a"),
		key.WithHelp("a", "accept"),
	),
	Reject: key.NewBinding(
		key.WithKeys("r"),
		key.WithHelp("r", "reject"),
	),
	Next: key.NewBinding(
		key.WithKeys("tab"),
		key.WithHelp("tab", "next"),
	),
	Prev: key.NewBinding(
		key.WithKeys("shift+tab"),
		key.WithHelp("shift+tab", "prev"),
	),
	Exit: key.NewBinding(
		key.WithKeys("esc"),
		key.WithHelp("esc", "exit"),
	),
	Retry: key.NewBinding(
		key.WithKeys("ctrl+r"),
		key.WithHelp("ctrl+r", "retry"),
	),
}
View Source
var Keys = KeyMap{
	Up: key.NewBinding(
		key.WithKeys("up"),
		key.WithHelp("↑", "up"),
	),
	Down: key.NewBinding(
		key.WithKeys("down"),
		key.WithHelp("↓", "down"),
	),
	Top: key.NewBinding(
		key.WithKeys("shift+up"),
		key.WithHelp("shift+↑", "top"),
	),
	Bottom: key.NewBinding(
		key.WithKeys("shift+down"),
		key.WithHelp("shift+↓", "bottom"),
	),
	Enter: key.NewBinding(
		key.WithKeys("enter"),
		key.WithHelp("enter", "submit"),
	),
	Focus: key.NewBinding(
		key.WithKeys("/"),
		key.WithHelp("/", "begin input"),
	),
	Blur: key.NewBinding(
		key.WithKeys("esc"),
		key.WithHelp("esc", "cancel input"),
	),
	Save: key.NewBinding(
		key.WithKeys("s"),
		key.WithHelp("s", "save"),
	),
	Load: key.NewBinding(
		key.WithKeys("l"),
		key.WithHelp("l", "load"),
	),
	Undo: key.NewBinding(
		key.WithKeys("z"),
		key.WithHelp("z", "undo"),
	),
	Quit: key.NewBinding(
		key.WithKeys("ctrl+c", "q"),
		key.WithHelp("q", "exit"),
	),
}

Functions

func GetLanguage

func GetLanguage(filename string) string

func Highlight

func Highlight(content, language string) string

Types

type CompareKeysMap

type CompareKeysMap struct {
	Up     key.Binding
	Down   key.Binding
	Top    key.Binding
	Bottom key.Binding
	Accept key.Binding
	Reject key.Binding
	Next   key.Binding
	Prev   key.Binding
	Exit   key.Binding
	Retry  key.Binding
}

func (CompareKeysMap) FullHelp

func (k CompareKeysMap) FullHelp() [][]key.Binding

FullHelp returns keybindings for the expanded help view. It's part of the key.Map interface.

func (CompareKeysMap) ShortHelp

func (k CompareKeysMap) ShortHelp() []key.Binding

ShortHelp returns keybindings to be shown in the mini help view. It's part of the key.Map interface.

type FileBuffer

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

func NewFile

func NewFile(path string) *FileBuffer

func (*FileBuffer) Content

func (f *FileBuffer) Content() string

func (*FileBuffer) Display

func (f *FileBuffer) Display() string

func (*FileBuffer) Path

func (f *FileBuffer) Path() string

func (*FileBuffer) Save

func (f *FileBuffer) Save() error

func (*FileBuffer) Set

func (f *FileBuffer) Set(content string)

func (*FileBuffer) Watch

func (f *FileBuffer) Watch(fn func()) error

type KeyMap

type KeyMap struct {
	Up     key.Binding
	Down   key.Binding
	Top    key.Binding
	Bottom key.Binding
	Enter  key.Binding
	Focus  key.Binding
	Blur   key.Binding
	Save   key.Binding
	Load   key.Binding
	Undo   key.Binding
	Quit   key.Binding
}

func (KeyMap) FullHelp

func (k KeyMap) FullHelp() [][]key.Binding

FullHelp returns keybindings for the expanded help view. It's part of the key.Map interface.

func (KeyMap) ShortHelp

func (k KeyMap) ShortHelp() []key.Binding

ShortHelp returns keybindings to be shown in the mini help view. It's part of the key.Map interface.

Jump to

Keyboard shortcuts

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