Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNoCommits : When no commits are found for the branch ErrNoCommits = errors.New("No commits for this branch") )
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
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 ¶
PrepareSubProcess - prepare a subprocess for execution and tell the gui to switch to it
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