keybindings

package
v1.2.132559162 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2020 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultKeys = map[string]interface{}{
	"quit":                gocui.KeyCtrlC,
	"copy":                gocui.KeyCtrlS,
	"listdelete":          gocui.KeyDelete,
	"fullscreen":          gocui.KeyF11,
	"help":                gocui.KeyCtrlI,
	"itemback":            gocui.KeyBackspace2,
	"itemleft":            []interface{}{gocui.KeyArrowLeft, rune('h')},
	"listactions":         gocui.KeyCtrlA,
	"listback":            gocui.KeyBackspace2,
	"listbacklegacy":      gocui.KeyBackspace,
	"listdown":            []interface{}{gocui.KeyArrowDown, rune('j')},
	"listup":              []interface{}{gocui.KeyArrowUp, rune('k')},
	"listright":           []interface{}{gocui.KeyArrowRight, rune('l')},
	"listedit":            gocui.KeyCtrlE,
	"listexpand":          gocui.KeyEnter,
	"listopen":            gocui.KeyCtrlO,
	"listrefresh":         gocui.KeyF5,
	"listupdate":          gocui.KeyCtrlU,
	"listpagedown":        gocui.KeyPgdn,
	"listpageup":          gocui.KeyPgup,
	"listend":             gocui.KeyEnd,
	"listhome":            gocui.KeyHome,
	"listclearfilter":     gocui.KeyEsc,
	"confirmdelete":       gocui.KeyCtrlY,
	"clearpendingdeletes": gocui.KeyCtrlN,
	"itempagedown":        gocui.KeyPgdn,
	"itempageup":          gocui.KeyPgup,
	"commandpanelopen":    gocui.KeyCtrlP,
	"commandpaneldown":    gocui.KeyArrowDown,
	"commandpanelup":      gocui.KeyArrowUp,
	"commandpanelenter":   gocui.KeyEnter,
	"filter":              rune('/'),
	"commandpanelclose":   gocui.KeyEsc,
	"azuresearchquery":    gocui.KeyCtrlR,
}

DefaultKeys are the default key bindings for each handler.

View Source
var GocuiKeyToStr = map[gocui.Key]string{
	gocui.KeyArrowUp:        "up",
	gocui.KeyArrowDown:      "down",
	gocui.KeyArrowLeft:      "left",
	gocui.KeyArrowRight:     "right",
	gocui.KeyDelete:         "delete",
	gocui.KeyHome:           "home",
	gocui.KeyEnd:            "end",
	gocui.KeyPgup:           "pageup",
	gocui.KeyPgdn:           "pagedown",
	gocui.KeyInsert:         "insert",
	gocui.KeySpace:          "space",
	gocui.KeyCtrl2:          "ctrl+2 or ctrl+~ or ctrl+space",
	gocui.KeyCtrl4:          "ctrl+4",
	gocui.KeyCtrl6:          "ctrl+6",
	gocui.KeyCtrl8:          "ctrl+8 or backspace2",
	gocui.KeyCtrlLsqBracket: "ctrl+[ or esc or ctrl+3",
	gocui.KeyCtrlRsqBracket: "ctrl+] or ctrl+5",
	gocui.KeyCtrlUnderscore: "ctrl+_ or ctrl+7",
	gocui.KeyCtrlA:          "ctrl+a",
	gocui.KeyCtrlB:          "ctrl+b",
	gocui.KeyCtrlC:          "ctrl+c",
	gocui.KeyCtrlD:          "ctrl+d",
	gocui.KeyCtrlE:          "ctrl+e",
	gocui.KeyCtrlF:          "ctrl+f",
	gocui.KeyCtrlG:          "ctrl+g",
	gocui.KeyCtrlH:          "ctrl+h or ctrl+backspace",
	gocui.KeyCtrlI:          "ctrl+i or tab",
	gocui.KeyCtrlJ:          "ctrl+j",
	gocui.KeyCtrlK:          "ctrl+k",
	gocui.KeyCtrlL:          "ctrl+l",
	gocui.KeyCtrlM:          "enter or ctrl+m",
	gocui.KeyCtrlN:          "ctrl+n",
	gocui.KeyCtrlO:          "ctrl+o",
	gocui.KeyCtrlP:          "ctrl+p",
	gocui.KeyCtrlQ:          "ctrl+q",
	gocui.KeyCtrlR:          "ctrl+r",
	gocui.KeyCtrlS:          "ctrl+s",
	gocui.KeyCtrlT:          "ctrl+t",
	gocui.KeyCtrlU:          "ctrl+u",
	gocui.KeyCtrlV:          "ctrl+v",
	gocui.KeyCtrlW:          "ctrl+w",
	gocui.KeyCtrlX:          "ctrl+x",
	gocui.KeyCtrlY:          "ctrl+y",
	gocui.KeyCtrlZ:          "ctrl+z",
	gocui.KeyF1:             "f1",
	gocui.KeyF2:             "f2",
	gocui.KeyF3:             "f3",
	gocui.KeyF4:             "f4",
	gocui.KeyF5:             "f5",
	gocui.KeyF6:             "f6",
	gocui.KeyF7:             "f7",
	gocui.KeyF8:             "f8",
	gocui.KeyF9:             "f9",
	gocui.KeyF10:            "f10",
	gocui.KeyF11:            "f11",
	gocui.KeyF12:            "f12",
}

GocuiKeyToStr maps a gocui key to a string

View Source
var StrToGocuiKey = map[string]gocui.Key{
	"up":         gocui.KeyArrowUp,
	"down":       gocui.KeyArrowDown,
	"left":       gocui.KeyArrowLeft,
	"right":      gocui.KeyArrowRight,
	"backspace":  gocui.KeyBackspace,
	"backspace2": gocui.KeyBackspace2,
	"delete":     gocui.KeyDelete,
	"home":       gocui.KeyHome,
	"end":        gocui.KeyEnd,
	"pageup":     gocui.KeyPgup,
	"pagedown":   gocui.KeyPgdn,
	"insert":     gocui.KeyInsert,
	"tab":        gocui.KeyTab,
	"space":      gocui.KeySpace,
	"ctrl+2":     gocui.KeyCtrl2,
	"ctrl+3":     gocui.KeyCtrl3,
	"ctrl+4":     gocui.KeyCtrl4,
	"ctrl+5":     gocui.KeyCtrl5,
	"ctrl+6":     gocui.KeyCtrl6,
	"ctrl+7":     gocui.KeyCtrl7,
	"ctrl+8":     gocui.KeyCtrl8,
	"ctrl+[":     gocui.KeyCtrlLsqBracket,
	"ctrl+]":     gocui.KeyCtrlRsqBracket,
	"ctrl+space": gocui.KeyCtrlSpace,
	"ctrl+_":     gocui.KeyCtrlUnderscore,
	"ctrl+~":     gocui.KeyCtrlTilde,
	"ctrl+a":     gocui.KeyCtrlA,
	"ctrl+b":     gocui.KeyCtrlB,
	"ctrl+c":     gocui.KeyCtrlC,
	"ctrl+d":     gocui.KeyCtrlD,
	"ctrl+e":     gocui.KeyCtrlE,
	"ctrl+f":     gocui.KeyCtrlF,
	"ctrl+g":     gocui.KeyCtrlG,
	"ctrl+h":     gocui.KeyCtrlH,
	"ctrl+i":     gocui.KeyCtrlI,
	"ctrl+j":     gocui.KeyCtrlJ,
	"ctrl+k":     gocui.KeyCtrlK,
	"ctrl+l":     gocui.KeyCtrlL,
	"ctrl+m":     gocui.KeyCtrlM,
	"ctrl+n":     gocui.KeyCtrlN,
	"ctrl+o":     gocui.KeyCtrlO,
	"ctrl+p":     gocui.KeyCtrlP,
	"ctrl+q":     gocui.KeyCtrlQ,
	"ctrl+r":     gocui.KeyCtrlR,
	"ctrl+s":     gocui.KeyCtrlS,
	"ctrl+t":     gocui.KeyCtrlT,
	"ctrl+u":     gocui.KeyCtrlU,
	"ctrl+v":     gocui.KeyCtrlV,
	"ctrl+w":     gocui.KeyCtrlW,
	"ctrl+x":     gocui.KeyCtrlX,
	"ctrl+y":     gocui.KeyCtrlY,
	"ctrl+z":     gocui.KeyCtrlZ,
	"esc":        gocui.KeyEsc,
	"f1":         gocui.KeyF1,
	"f2":         gocui.KeyF2,
	"f3":         gocui.KeyF3,
	"f4":         gocui.KeyF4,
	"f5":         gocui.KeyF5,
	"f6":         gocui.KeyF6,
	"f7":         gocui.KeyF7,
	"f8":         gocui.KeyF8,
	"f9":         gocui.KeyF9,
	"f10":        gocui.KeyF10,
	"f11":        gocui.KeyF11,
	"f12":        gocui.KeyF12,
	"enter":      gocui.KeyEnter,
}

StrToGocuiKey maps a string representing they key to a gocui key

Functions

func AddHandler

func AddHandler(hnd KeyHandler)

AddHandler Adds a keybinding handler for use in Bind

func Bind

func Bind(g *gocui.Gui) error

Bind sets up key bindings for AzBrowse

func GetKeyBindingsAsStrings

func GetKeyBindingsAsStrings() map[string][]string

GetKeyBindingsAsStrings provides a map of Handler->Key in string format

Types

type ClearPendingDeleteHandler added in v1.1.170

type ClearPendingDeleteHandler struct {
	GlobalHandler
	// contains filtered or unexported fields
}

//////////////////////////////////////////////////////////////////

func NewClearPendingDeleteHandler added in v1.1.170

func NewClearPendingDeleteHandler(notificationWidget *views.NotificationWidget) *ClearPendingDeleteHandler

func (*ClearPendingDeleteHandler) Fn added in v1.1.170

func (h *ClearPendingDeleteHandler) Fn() func(g *gocui.Gui, v *gocui.View) error

type CloseCommandPanelHandler added in v1.1.333

type CloseCommandPanelHandler struct {
	CommandPanelHandler
	// contains filtered or unexported fields
}

func NewCloseCommandPanelHandler added in v1.1.333

func NewCloseCommandPanelHandler(commandPanelWidget *views.CommandPanelWidget) *CloseCommandPanelHandler

func (*CloseCommandPanelHandler) Fn added in v1.1.333

func (h *CloseCommandPanelHandler) Fn() func(g *gocui.Gui, v *gocui.View) error

type Command added in v1.1.441

type Command interface {
	ID() string
	DisplayText() string
	IsEnabled() bool
	Invoke() error
}

Command represents a command that can be listed in the Command Palette

type CommandPanelAzureSearchQueryHandler added in v1.1.427

type CommandPanelAzureSearchQueryHandler struct {
	ListHandler
	// contains filtered or unexported fields
}

//////////////////////////////////////////////////////////////////

func NewCommandPanelAzureSearchQueryHandler added in v1.1.427

func NewCommandPanelAzureSearchQueryHandler(commandPanelWidget *views.CommandPanelWidget, content *views.ItemWidget, list *views.ListWidget) *CommandPanelAzureSearchQueryHandler

func (*CommandPanelAzureSearchQueryHandler) CommandPanelNotification added in v1.1.441

func (h *CommandPanelAzureSearchQueryHandler) CommandPanelNotification(state views.CommandPanelNotification)

func (*CommandPanelAzureSearchQueryHandler) DisplayText added in v1.1.441

func (*CommandPanelAzureSearchQueryHandler) Fn added in v1.1.427

func (*CommandPanelAzureSearchQueryHandler) Invoke added in v1.1.441

func (*CommandPanelAzureSearchQueryHandler) IsEnabled added in v1.1.441

type CommandPanelDownHandler added in v1.1.441

type CommandPanelDownHandler struct {
	CommandPanelHandler
	// contains filtered or unexported fields
}

func NewCommandPanelDownHandler added in v1.1.441

func NewCommandPanelDownHandler(commandPanelWidget *views.CommandPanelWidget) *CommandPanelDownHandler

func (*CommandPanelDownHandler) Fn added in v1.1.441

func (h *CommandPanelDownHandler) Fn() func(g *gocui.Gui, v *gocui.View) error

type CommandPanelEnterHandler added in v1.1.441

type CommandPanelEnterHandler struct {
	CommandPanelHandler
	// contains filtered or unexported fields
}

func NewCommandPanelEnterHandler added in v1.1.441

func NewCommandPanelEnterHandler(commandPanelWidget *views.CommandPanelWidget) *CommandPanelEnterHandler

func (*CommandPanelEnterHandler) Fn added in v1.1.441

func (h *CommandPanelEnterHandler) Fn() func(g *gocui.Gui, v *gocui.View) error

type CommandPanelFilterHandler added in v1.1.333

type CommandPanelFilterHandler struct {
	GlobalHandler
	// contains filtered or unexported fields
}

//////////////////////////////////////////////////////////////////

func NewCommandPanelFilterHandler added in v1.1.333

func NewCommandPanelFilterHandler(commandPanelWidget *views.CommandPanelWidget, list *views.ListWidget) *CommandPanelFilterHandler

func (*CommandPanelFilterHandler) CommandPanelNotification added in v1.1.441

func (h *CommandPanelFilterHandler) CommandPanelNotification(state views.CommandPanelNotification)

func (*CommandPanelFilterHandler) DisplayText added in v1.1.441

func (h *CommandPanelFilterHandler) DisplayText() string

func (*CommandPanelFilterHandler) Fn added in v1.1.333

func (h *CommandPanelFilterHandler) Fn() func(g *gocui.Gui, v *gocui.View) error

func (*CommandPanelFilterHandler) Invoke added in v1.1.441

func (h *CommandPanelFilterHandler) Invoke() error

func (*CommandPanelFilterHandler) IsEnabled added in v1.1.441

func (h *CommandPanelFilterHandler) IsEnabled() bool

type CommandPanelHandler added in v1.1.333

type CommandPanelHandler struct {
	KeyHandlerBase
}

CommandPanelHandler is a parent struct for all key handlers not tied to a specific view.

func (CommandPanelHandler) Widget added in v1.1.333

func (h CommandPanelHandler) Widget() string

Widget returns the name of the widget this handler binds to

type CommandPanelUpHandler added in v1.1.441

type CommandPanelUpHandler struct {
	CommandPanelHandler
	// contains filtered or unexported fields
}

func NewCommandPanelUpHandler added in v1.1.441

func NewCommandPanelUpHandler(commandPanelWidget *views.CommandPanelWidget) *CommandPanelUpHandler

func (*CommandPanelUpHandler) Fn added in v1.1.441

func (h *CommandPanelUpHandler) Fn() func(g *gocui.Gui, v *gocui.View) error

type ConfirmDeleteHandler added in v1.1.170

type ConfirmDeleteHandler struct {
	GlobalHandler
	// contains filtered or unexported fields
}

//////////////////////////////////////////////////////////////////

func NewConfirmDeleteHandler added in v1.1.170

func NewConfirmDeleteHandler(notificationWidget *views.NotificationWidget) *ConfirmDeleteHandler

func (*ConfirmDeleteHandler) Fn added in v1.1.170

func (h *ConfirmDeleteHandler) Fn() func(g *gocui.Gui, v *gocui.View) error

type CopyHandler

type CopyHandler struct {
	GlobalHandler
	Content   *views.ItemWidget
	StatusBar *views.StatusbarWidget
}

//////////////////////////////////////////////////////////////////

func NewCopyHandler

func NewCopyHandler(content *views.ItemWidget, statusbar *views.StatusbarWidget) *CopyHandler

func (*CopyHandler) DisplayText added in v1.1.441

func (h *CopyHandler) DisplayText() string

func (CopyHandler) Fn

func (h CopyHandler) Fn() func(g *gocui.Gui, v *gocui.View) error

func (*CopyHandler) Invoke added in v1.1.441

func (h *CopyHandler) Invoke() error

func (*CopyHandler) IsEnabled added in v1.1.441

func (h *CopyHandler) IsEnabled() bool

type FullscreenHandler

type FullscreenHandler struct {
	GlobalHandler
	List         *views.ListWidget
	IsFullscreen *bool
	Content      *views.ItemWidget
}

//////////////////////////////////////////////////////////////////

func NewFullscreenHandler

func NewFullscreenHandler(list *views.ListWidget, content *views.ItemWidget, isFullscreen *bool) *FullscreenHandler

func (FullscreenHandler) Fn

func (h FullscreenHandler) Fn() func(g *gocui.Gui, v *gocui.View) error

type GlobalHandler

type GlobalHandler struct {
	KeyHandlerBase
}

GlobalHandler is a parent struct for all key handlers not tied to a specific view.

func (GlobalHandler) Widget

func (h GlobalHandler) Widget() string

Widget returns the name of the widget this handler binds to

type HandlerID added in v1.1.285

type HandlerID string

HandlerID is used as the ID for Key Handlers

const (
	HandlerIDQuit                    HandlerID = "quit"                  //nolint:golint
	HandlerIDCopy                    HandlerID = "copy"                  //nolint:golint
	HandlerIDListDelete              HandlerID = "listdelete"            //nolint:golint
	HandlerIDFullScreen              HandlerID = "fullscreen"            //nolint:golint
	HandlerIDHelp                    HandlerID = "help"                  //nolint:golint
	HandlerIDItemBack                HandlerID = "itemback"              //nolint:golint
	HandlerIDItemLeft                HandlerID = "itemleft"              //nolint:golint
	HandlerIDListActions             HandlerID = "listactions"           //nolint:golint
	HandlerIDListBack                HandlerID = "listback"              //nolint:golint
	HandlerIDListBackLegacy          HandlerID = "listbacklegacy"        //nolint:golint
	HandlerIDListDown                HandlerID = "listdown"              //nolint:golint
	HandlerIDListUp                  HandlerID = "listup"                //nolint:golint
	HandlerIDListRight               HandlerID = "listright"             //nolint:golint
	HandlerIDListEdit                HandlerID = "listedit"              //nolint:golint
	HandlerIDListExpand              HandlerID = "listexpand"            //nolint:golint
	HandlerIDListOpen                HandlerID = "listopen"              //nolint:golint
	HandlerIDListRefresh             HandlerID = "listrefresh"           //nolint:golint
	HandlerIDListUpdate              HandlerID = "listupdate"            //nolint:golint
	HandlerIDListPageDown            HandlerID = "listpagedown"          //nolint:golint
	HandlerIDListPageUp              HandlerID = "listpageup"            //nolint:golint
	HandlerIDListEnd                 HandlerID = "listend"               //nolint:golint
	HandlerIDListHome                HandlerID = "listhome"              //nolint:golint
	HandlerIDListClearFilter         HandlerID = "listclearfilter"       //nolint:golint
	HandlerIDListCopyItemID          HandlerID = "listcopyitemid"        //nolint:golint
	HandlerIDListDebugCopyItemData   HandlerID = "listdebugcopyitemdata" //nolint:golint
	HandlerIDConfirmDelete           HandlerID = "confirmdelete"         //nolint:golint
	HandlerIDClearPendingDeletes     HandlerID = "clearpendingdeletes"   //nolint:golint
	HandlerIDItemPageDown            HandlerID = "itempagedown"          //nolint:golint
	HandlerIDItemPageUp              HandlerID = "itempageup"            //nolint:golint
	HandlerIDToggleOpenCommandPanel  HandlerID = "commandpanelopen"      //nolint:golint
	HandlerIDToggleCloseCommandPanel HandlerID = "commandpanelclose"     //nolint:golint
	HandlerIDCommandPanelDown        HandlerID = "commandpaneldown"      //nolint:golint
	HandlerIDCommandPanelUp          HandlerID = "commandpanelup"        //nolint:golint
	HandlerIDCommandPanelEnter       HandlerID = "commandpanelenter"     //nolint:golint
	HandlerIDFilter                  HandlerID = "filter"                //nolint:golint
	HandlerIDAzureSearchQuery        HandlerID = "azuresearchquery"      //nolist:golint
	HandlerIDToggleDemoMode          HandlerID = "toggledemomode"        //nolist:golint
	HandlerIDListSort                HandlerID = "listsort"              //nolint:golint
)

type HelpHandler

type HelpHandler struct {
	GlobalHandler
	ShowHelp *bool
}

//////////////////////////////////////////////////////////////////

func NewHelpHandler

func NewHelpHandler(showHelp *bool) *HelpHandler

func (HelpHandler) Fn

func (h HelpHandler) Fn() func(g *gocui.Gui, v *gocui.View) error

type ItemBackHandler

type ItemBackHandler struct {
	ItemHandler
	List *views.ListWidget
}

//////////////////////////////////////////////////////////////////

func NewItemBackHandler

func NewItemBackHandler(list *views.ListWidget) *ItemBackHandler

func (ItemBackHandler) Fn

func (h ItemBackHandler) Fn() func(g *gocui.Gui, v *gocui.View) error

type ItemCopyItemIDHandler added in v1.2.104948434

type ItemCopyItemIDHandler struct {
	ListHandler
	Item      *views.ItemWidget
	StatusBar *views.StatusbarWidget
}

//////////////////////////////////////////////////////////////////

func NewItemCopyItemIDHandler added in v1.2.104948434

func NewItemCopyItemIDHandler(item *views.ItemWidget, statusBar *views.StatusbarWidget) *ItemCopyItemIDHandler

func (*ItemCopyItemIDHandler) DisplayText added in v1.2.104948434

func (h *ItemCopyItemIDHandler) DisplayText() string

func (ItemCopyItemIDHandler) Fn added in v1.2.104948434

func (h ItemCopyItemIDHandler) Fn() func(g *gocui.Gui, v *gocui.View) error

func (*ItemCopyItemIDHandler) Invoke added in v1.2.104948434

func (h *ItemCopyItemIDHandler) Invoke() error

func (*ItemCopyItemIDHandler) IsEnabled added in v1.2.104948434

func (h *ItemCopyItemIDHandler) IsEnabled() bool

type ItemHandler

type ItemHandler struct {
	KeyHandlerBase
}

ItemHandler is a parent struct for all key handlers tied to the item widget view

func (ItemHandler) Widget

func (h ItemHandler) Widget() string

Widget returns the name of the widget this handler binds to

type ItemLeftHandler

type ItemLeftHandler struct {
	ItemHandler
	EditModeEnabled *bool
}

//////////////////////////////////////////////////////////////////

func NewItemLeftHandler

func NewItemLeftHandler(editModeEnabled *bool) *ItemLeftHandler

func (ItemLeftHandler) Fn

func (h ItemLeftHandler) Fn() func(g *gocui.Gui, v *gocui.View) error

type ItemViewPageDownHandler added in v1.1.251

type ItemViewPageDownHandler struct {
	ItemHandler
	ItemView *views.ItemWidget
}

//////////////////////////////////////////////////////////////////

func NewItemViewPageDownHandler added in v1.1.251

func NewItemViewPageDownHandler(itemView *views.ItemWidget) *ItemViewPageDownHandler

func (ItemViewPageDownHandler) Fn added in v1.1.251

func (h ItemViewPageDownHandler) Fn() func(g *gocui.Gui, v *gocui.View) error

type ItemViewPageUpHandler added in v1.1.251

type ItemViewPageUpHandler struct {
	ItemHandler
	ItemView *views.ItemWidget
}

//////////////////////////////////////////////////////////////////

func NewItemViewPageUpHandler added in v1.1.251

func NewItemViewPageUpHandler(itemView *views.ItemWidget) *ItemViewPageUpHandler

func (ItemViewPageUpHandler) Fn added in v1.1.251

func (h ItemViewPageUpHandler) Fn() func(g *gocui.Gui, v *gocui.View) error

type KeyHandler

type KeyHandler interface {
	ID() string
	Fn() func(g *gocui.Gui, v *gocui.View) error
	Widget() string

	DefaultKey() interface{}
}

KeyHandler is an interface that all key handlers must implement

type KeyHandlerBase

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

KeyHandlerBase A base structure that will return the associated handler id from the HandlersId array and a default key for the handler.

func (KeyHandlerBase) DefaultKey

func (h KeyHandlerBase) DefaultKey() interface{}

DefaultKey returns the default key mapped to the handler

func (KeyHandlerBase) ID added in v1.1.50

func (h KeyHandlerBase) ID() string

ID returns the name of this item for example "listup"

type KeyMap

type KeyMap map[string][]interface{}

KeyMap reprsents the current mappings from Handler -> Key

type ListActionsHandler

type ListActionsHandler struct {
	ListHandler
	List    *views.ListWidget
	Context context.Context
}

//////////////////////////////////////////////////////////////////

func NewListActionsHandler

func NewListActionsHandler(list *views.ListWidget, context context.Context) *ListActionsHandler

func (*ListActionsHandler) DisplayText added in v1.1.441

func (h *ListActionsHandler) DisplayText() string

func (ListActionsHandler) Fn

func (h ListActionsHandler) Fn() func(g *gocui.Gui, v *gocui.View) error

func (*ListActionsHandler) Invoke added in v1.1.441

func (h *ListActionsHandler) Invoke() error

func (*ListActionsHandler) IsEnabled added in v1.1.441

func (h *ListActionsHandler) IsEnabled() bool

type ListBackHandler

type ListBackHandler struct {
	ListHandler
	List *views.ListWidget
}

//////////////////////////////////////////////////////////////////

func NewListBackHandler

func NewListBackHandler(list *views.ListWidget) *ListBackHandler

func (ListBackHandler) Fn

func (h ListBackHandler) Fn() func(g *gocui.Gui, v *gocui.View) error

type ListBackLegacyHandler

type ListBackLegacyHandler struct {
	ListHandler
	List *views.ListWidget
}

//////////////////////////////////////////////////////////////////

func NewListBackLegacyHandler

func NewListBackLegacyHandler(list *views.ListWidget) *ListBackLegacyHandler

func (ListBackLegacyHandler) Fn

func (h ListBackLegacyHandler) Fn() func(g *gocui.Gui, v *gocui.View) error

type ListClearFilterHandler added in v1.1.333

type ListClearFilterHandler struct {
	ListHandler
	List *views.ListWidget
}

//////////////////////////////////////////////////////////////////

func NewListClearFilterHandler added in v1.1.333

func NewListClearFilterHandler(list *views.ListWidget) *ListClearFilterHandler

func (ListClearFilterHandler) Fn added in v1.1.333

func (h ListClearFilterHandler) Fn() func(g *gocui.Gui, v *gocui.View) error

type ListDebugCopyItemDataHandler added in v1.1.485

type ListDebugCopyItemDataHandler struct {
	ListHandler
	List      *views.ListWidget
	StatusBar *views.StatusbarWidget
}

//////////////////////////////////////////////////////////////////

func NewListDebugCopyItemDataHandler added in v1.1.485

func NewListDebugCopyItemDataHandler(list *views.ListWidget, statusBar *views.StatusbarWidget) *ListDebugCopyItemDataHandler

func (*ListDebugCopyItemDataHandler) DisplayText added in v1.1.485

func (h *ListDebugCopyItemDataHandler) DisplayText() string

func (ListDebugCopyItemDataHandler) Fn added in v1.1.485

func (h ListDebugCopyItemDataHandler) Fn() func(g *gocui.Gui, v *gocui.View) error

func (*ListDebugCopyItemDataHandler) Invoke added in v1.1.485

func (h *ListDebugCopyItemDataHandler) Invoke() error

func (*ListDebugCopyItemDataHandler) IsEnabled added in v1.1.485

func (h *ListDebugCopyItemDataHandler) IsEnabled() bool

type ListDeleteHandler

type ListDeleteHandler struct {
	ListHandler
	List               *views.ListWidget
	NotificationWidget *views.NotificationWidget
}

//////////////////////////////////////////////////////////////////

func NewListDeleteHandler

func NewListDeleteHandler(list *views.ListWidget, notificationWidget *views.NotificationWidget) *ListDeleteHandler

func (ListDeleteHandler) Fn

func (h ListDeleteHandler) Fn() func(g *gocui.Gui, v *gocui.View) error

type ListDownHandler

type ListDownHandler struct {
	ListHandler
	List *views.ListWidget
}

//////////////////////////////////////////////////////////////////

func NewListDownHandler

func NewListDownHandler(list *views.ListWidget) *ListDownHandler

func (ListDownHandler) Fn

func (h ListDownHandler) Fn() func(g *gocui.Gui, v *gocui.View) error

type ListEditHandler

type ListEditHandler struct {
	ListHandler
	List            *views.ListWidget
	EditModeEnabled *bool
}

//////////////////////////////////////////////////////////////////

func NewListEditHandler

func NewListEditHandler(list *views.ListWidget, editModeEnabled *bool) *ListEditHandler

func (ListEditHandler) Fn

func (h ListEditHandler) Fn() func(g *gocui.Gui, v *gocui.View) error

type ListEndHandler added in v1.1.104

type ListEndHandler struct {
	ListHandler
	List *views.ListWidget
}

/////////////////////////////////////////////////////////////////

func NewListEndHandler added in v1.1.104

func NewListEndHandler(list *views.ListWidget) *ListEndHandler

func (ListEndHandler) Fn added in v1.1.104

func (h ListEndHandler) Fn() func(g *gocui.Gui, v *gocui.View) error

type ListExpandHandler

type ListExpandHandler struct {
	ListHandler
	List *views.ListWidget
}

//////////////////////////////////////////////////////////////////

func NewListExpandHandler

func NewListExpandHandler(list *views.ListWidget) *ListExpandHandler

func (ListExpandHandler) Fn

func (h ListExpandHandler) Fn() func(g *gocui.Gui, v *gocui.View) error

type ListHandler

type ListHandler struct {
	KeyHandlerBase
}

ListHandler is a parent struct for all key handlers tied to the list widget view

func (ListHandler) Widget

func (h ListHandler) Widget() string

Widget returns the name of the widget this handler binds to

type ListHomeHandler added in v1.1.104

type ListHomeHandler struct {
	ListHandler
	List *views.ListWidget
}

/////////////////////////////////////////////////////////////////

func NewListHomeHandler added in v1.1.104

func NewListHomeHandler(list *views.ListWidget) *ListHomeHandler

func (ListHomeHandler) Fn added in v1.1.104

func (h ListHomeHandler) Fn() func(g *gocui.Gui, v *gocui.View) error

type ListOpenHandler

type ListOpenHandler struct {
	ListHandler
	List    *views.ListWidget
	Context context.Context
}

//////////////////////////////////////////////////////////////////

func NewListOpenHandler

func NewListOpenHandler(list *views.ListWidget, context context.Context) *ListOpenHandler

func (*ListOpenHandler) DisplayText added in v1.1.441

func (h *ListOpenHandler) DisplayText() string

func (ListOpenHandler) Fn

func (h ListOpenHandler) Fn() func(g *gocui.Gui, v *gocui.View) error

func (*ListOpenHandler) Invoke added in v1.1.441

func (h *ListOpenHandler) Invoke() error

func (*ListOpenHandler) IsEnabled added in v1.1.441

func (h *ListOpenHandler) IsEnabled() bool

type ListPageDownHandler added in v1.1.104

type ListPageDownHandler struct {
	ListHandler
	List *views.ListWidget
}

/////////////////////////////////////////////////////////////////

func NewListPageDownHandler added in v1.1.104

func NewListPageDownHandler(list *views.ListWidget) *ListPageDownHandler

func (ListPageDownHandler) Fn added in v1.1.104

func (h ListPageDownHandler) Fn() func(g *gocui.Gui, v *gocui.View) error

type ListPageUpHandler added in v1.1.104

type ListPageUpHandler struct {
	ListHandler
	List *views.ListWidget
}

/////////////////////////////////////////////////////////////////

func NewListPageUpHandler added in v1.1.104

func NewListPageUpHandler(list *views.ListWidget) *ListPageUpHandler

func (ListPageUpHandler) Fn added in v1.1.104

func (h ListPageUpHandler) Fn() func(g *gocui.Gui, v *gocui.View) error

type ListRefreshHandler

type ListRefreshHandler struct {
	ListHandler
	List *views.ListWidget
}

//////////////////////////////////////////////////////////////////

func NewListRefreshHandler

func NewListRefreshHandler(list *views.ListWidget) *ListRefreshHandler

func (ListRefreshHandler) Fn

func (h ListRefreshHandler) Fn() func(g *gocui.Gui, v *gocui.View) error

type ListRightHandler

type ListRightHandler struct {
	ListHandler
	List            *views.ListWidget
	EditModeEnabled *bool
}

//////////////////////////////////////////////////////////////////

func NewListRightHandler

func NewListRightHandler(list *views.ListWidget, editModeEnabled *bool) *ListRightHandler

func (ListRightHandler) Fn

func (h ListRightHandler) Fn() func(g *gocui.Gui, v *gocui.View) error

type ListSortHandler added in v1.2.132539125

type ListSortHandler struct {
	ListHandler
	List *views.ListWidget
}

//////////////////////////////////////////////////////////////////

func NewListSortHandler added in v1.2.132539125

func NewListSortHandler(list *views.ListWidget) *ListSortHandler

func (*ListSortHandler) DisplayText added in v1.2.132539125

func (h *ListSortHandler) DisplayText() string

func (ListSortHandler) Fn added in v1.2.132539125

func (h ListSortHandler) Fn() func(g *gocui.Gui, v *gocui.View) error

func (*ListSortHandler) Invoke added in v1.2.132539125

func (h *ListSortHandler) Invoke() error

func (*ListSortHandler) IsEnabled added in v1.2.132539125

func (h *ListSortHandler) IsEnabled() bool

type ListUpHandler

type ListUpHandler struct {
	ListHandler
	List *views.ListWidget
}

//////////////////////////////////////////////////////////////////

func NewListUpHandler

func NewListUpHandler(list *views.ListWidget) *ListUpHandler

func (ListUpHandler) Fn

func (h ListUpHandler) Fn() func(g *gocui.Gui, v *gocui.View) error

type ListUpdateHandler

type ListUpdateHandler struct {
	ListHandler
	List *views.ListWidget

	Context context.Context
	Content *views.ItemWidget
	Gui     *gocui.Gui
	// contains filtered or unexported fields
}

//////////////////////////////////////////////////////////////////

func NewListUpdateHandler

func NewListUpdateHandler(list *views.ListWidget, statusbar *views.StatusbarWidget, ctx context.Context, content *views.ItemWidget, gui *gocui.Gui) *ListUpdateHandler

func (*ListUpdateHandler) DisplayText added in v1.1.441

func (h *ListUpdateHandler) DisplayText() string

func (ListUpdateHandler) Fn

func (h ListUpdateHandler) Fn() func(g *gocui.Gui, v *gocui.View) error

func (*ListUpdateHandler) Invoke added in v1.1.441

func (h *ListUpdateHandler) Invoke() error

func (*ListUpdateHandler) IsEnabled added in v1.1.441

func (h *ListUpdateHandler) IsEnabled() bool

type OpenCommandPanelHandler added in v1.1.333

type OpenCommandPanelHandler struct {
	GlobalHandler
	// contains filtered or unexported fields
}

//////////////////////////////////////////////////////////////////

func NewOpenCommandPanelHandler added in v1.1.333

func NewOpenCommandPanelHandler(gui *gocui.Gui, commandPanelWidget *views.CommandPanelWidget, commands []Command) *OpenCommandPanelHandler

func (*OpenCommandPanelHandler) CommandPanelNotification added in v1.1.441

func (h *OpenCommandPanelHandler) CommandPanelNotification(state views.CommandPanelNotification)

func (*OpenCommandPanelHandler) Fn added in v1.1.333

func (h *OpenCommandPanelHandler) Fn() func(g *gocui.Gui, v *gocui.View) error

type QuitHandler

type QuitHandler struct {
	GlobalHandler
}

//////////////////////////////////////////////////////////////////

func NewQuitHandler

func NewQuitHandler() *QuitHandler

func (QuitHandler) Fn

func (h QuitHandler) Fn() func(g *gocui.Gui, v *gocui.View) error

type SortByDisplayText added in v1.1.441

type SortByDisplayText []Command

SortByDisplayText allows sorting an array of Commands by DisplayText

func (SortByDisplayText) Len added in v1.1.441

func (s SortByDisplayText) Len() int

func (SortByDisplayText) Less added in v1.1.441

func (s SortByDisplayText) Less(i, j int) bool

func (SortByDisplayText) Swap added in v1.1.441

func (s SortByDisplayText) Swap(i, j int)

type ToggleDemoModeHandler added in v1.1.485

type ToggleDemoModeHandler struct {
	GlobalHandler
	Settings *config.Settings
	List     *views.ListWidget
	Status   *views.StatusbarWidget
	Content  *views.ItemWidget
}

//////////////////////////////////////////////////////////////////

func NewToggleDemoModeHandler added in v1.1.485

func NewToggleDemoModeHandler(settings *config.Settings, list *views.ListWidget, status *views.StatusbarWidget, content *views.ItemWidget) *ToggleDemoModeHandler

func (*ToggleDemoModeHandler) DisplayText added in v1.1.485

func (h *ToggleDemoModeHandler) DisplayText() string

func (ToggleDemoModeHandler) Fn added in v1.1.485

func (h ToggleDemoModeHandler) Fn() func(g *gocui.Gui, v *gocui.View) error

func (*ToggleDemoModeHandler) Invoke added in v1.1.485

func (h *ToggleDemoModeHandler) Invoke() error

func (*ToggleDemoModeHandler) IsEnabled added in v1.1.485

func (h *ToggleDemoModeHandler) IsEnabled() bool

Jump to

Keyboard shortcuts

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