Documentation
¶
Overview ¶
Package app is laziergit's window: lazygit's functionality, through package core, in MyGo's native UI.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App is the state of a window on a repository.
func (*App) ChangedOnDisk ¶
func (a *App) ChangedOnDisk()
ChangedOnDisk refreshes after the work tree or the repository changed outside the app. It skips changes the app's own commands and refreshes just made, and leaves a refresh running to finish.
func (*App) Close ¶
func (a *App) Close()
Close closes the repository, as the window closes: git waiting on a credential is answered, so that it stops, and the repository closes once its command ends, off the UI thread.
func (*App) Open ¶
Open opens the repository dir is in, off the UI thread, and loads it. done, when set, is told how it went, on the UI thread.
func (*App) ShowSection ¶
ShowSection shows a section of the sidebar: changes, history, branches or stash.
type Host ¶
type Host struct {
// Post runs fn on the UI thread and rebuilds the view.
Post func(fn func())
// Go runs fn off the UI thread.
Go func(fn func())
// OpenRepository asks for a repository to open, and opens it: in this
// window while it has none, in a window of its own otherwise.
OpenRepository func()
// Opened is told of the repository the window opened.
Opened func(r *core.Repo)
// Idle, when set, is told when the window's actions are all done.
Idle func()
// Recent lists the repositories opened lately, newest first, and
// OpenRecent opens one, as OpenRepository does.
Recent func() []string
OpenRecent func(path string)
// Watch, when set, watches the work tree of a repository opened, to
// call App.ChangedOnDisk on the UI thread, in place of the last one.
Watch func(path string)
}
Host is what the app needs of its window: to run a function on the UI thread and draw again, and to run work off it.