app

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: MIT Imports: 15 Imported by: 0 modules, 0 packages

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

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 New

func New(host Host, opts core.Options) *App

New makes the app; Open opens its repository.

func (*App) Busy

func (a *App) Busy() bool

Busy reports whether an action runs or waits to.

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) Notice

func (a *App) Notice(title, desc string)

Notice shows a message in the window, as a toast.

func (*App) Open

func (a *App) Open(dir string, done func(error))

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) Repo

func (a *App) Repo() *core.Repo

Repo is the repository open, nil before one is.

func (*App) ShowSection

func (a *App) ShowSection(name string)

ShowSection shows a section of the sidebar: changes, history, branches or stash.

func (*App) View

func (a *App) View(c *ui.Context)

View builds the window.

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.

Jump to

Keyboard shortcuts

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