gui

package
v0.1.61 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: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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