gui

package
v0.1.58 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2018 License: MIT Imports: 19 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoCommits : When no commits are found for the branch
	ErrNoCommits = errors.New("No commits for this branch")
)
View Source
var (
	ErrSubProcess = errors.New("running subprocess")
)

ErrSubProcess tells us we're switching to a subprocess so we need to close the Gui until it is finished

View Source
var OverlappingEdges = false

OverlappingEdges determines if panel edges overlap

Functions

This section is empty.

Types

type Binding

type Binding struct {
	ViewName string
	Handler  func(*gocui.Gui, *gocui.View) error
	Key      interface{} // FIXME: find out how to get `gocui.Key | rune`
	Modifier gocui.Modifier
}

Binding - a keybinding mapping a key and modifier to a handler. The keypress is only handled if the given view has focus, or handled globally if the view is ""

type Gui

type Gui struct {
	Log        *logrus.Logger
	GitCommand *commands.GitCommand
	OSCommand  *commands.OSCommand
	Version    string
	SubProcess *exec.Cmd
	State      guiState
	// contains filtered or unexported fields
}

Gui wraps the gocui Gui object which handles rendering and events

func NewGui

func NewGui(log *logrus.Logger, gitCommand *commands.GitCommand, oSCommand *commands.OSCommand, version string) (*Gui, error)

NewGui builds a new gui handler

func (*Gui) PrepareSubProcess

func (gui *Gui) PrepareSubProcess(g *gocui.Gui, commands ...string) error

PrepareSubProcess - prepare a subprocess for execution and tell the gui to switch to it

func (*Gui) Run

func (gui *Gui) Run() error

Run setup the gui with keybindings and start the mainloop

func (*Gui) RunWithSubprocesses

func (gui *Gui) RunWithSubprocesses()

RunWithSubprocesses loops, instantiating a new gocui.Gui with each iteration if the error returned from a run is a ErrSubProcess, it runs the subprocess otherwise it handles the error, possibly by quitting the application

Jump to

Keyboard shortcuts

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