custom_commands

package
v0.38.1 Latest Latest
Warning

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

Go to latest
Published: May 2, 2023 License: MIT Imports: 20 Imported by: ? 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is the entry point to this package. It returns a list of keybindings based on the config's user-defined custom commands. See https://github.com/jesseduffield/lazygit/blob/master/docs/Custom_Command_Keybindings.md for more info.

func NewClient

func NewClient(
	c *types.HelperCommon,
	os *oscommands.OSCommand,
	git *commands.GitCommand,
	contexts *context.ContextTree,
	helpers *helpers.Helpers,
) *Client

func (*Client) GetCustomCommandKeybindings

func (self *Client) GetCustomCommandKeybindings() ([]*types.Binding, error)

type CustomCommandObject added in v0.36.0

type CustomCommandObject struct {
	// deprecated. Use Responses instead
	PromptResponses []string
	Form            map[string]string
}

type CustomCommandObjects

type CustomCommandObjects struct {
	*SessionState
	PromptResponses []string
	Form            map[string]string
}

type HandlerCreator

type HandlerCreator struct {
	// contains filtered or unexported fields
}

takes a custom command and returns a function that will be called when the corresponding user-defined keybinding is pressed

func NewHandlerCreator

func NewHandlerCreator(
	c *types.HelperCommon,
	os *oscommands.OSCommand,
	git *commands.GitCommand,
	sessionStateLoader *SessionStateLoader,
) *HandlerCreator

type KeybindingCreator

type KeybindingCreator struct {
	// contains filtered or unexported fields
}

KeybindingCreator takes a custom command along with its handler and returns a corresponding keybinding

func NewKeybindingCreator

func NewKeybindingCreator(contexts *context.ContextTree) *KeybindingCreator
type MenuGenerator struct {
	// contains filtered or unexported fields
}

func NewMenuGenerator

func NewMenuGenerator(c *common.Common) *MenuGenerator

takes the output of a command and returns a list of menu entries based on a filter and value/label format templates provided by the user

type Resolver

type Resolver struct {
	// contains filtered or unexported fields
}

takes a prompt that is defined in terms of template strings and resolves the templates to contain actual values

func NewResolver

func NewResolver(c *common.Common) *Resolver

type SessionState

type SessionState struct {
	SelectedLocalCommit    *models.Commit
	SelectedReflogCommit   *models.Commit
	SelectedSubCommit      *models.Commit
	SelectedFile           *models.File
	SelectedPath           string
	SelectedLocalBranch    *models.Branch
	SelectedRemoteBranch   *models.RemoteBranch
	SelectedRemote         *models.Remote
	SelectedTag            *models.Tag
	SelectedStashEntry     *models.StashEntry
	SelectedCommitFile     *models.CommitFile
	SelectedCommitFilePath string
	CheckedOutBranch       *models.Branch
}

SessionState captures the current state of the application for use in custom commands

type SessionStateLoader

type SessionStateLoader struct {
	// contains filtered or unexported fields
}

loads the session state at the time that a custom command is invoked, for use in the custom command's template strings

func NewSessionStateLoader

func NewSessionStateLoader(contexts *context.ContextTree, helpers *helpers.Helpers) *SessionStateLoader

type TrimmerTemplate

type TrimmerTemplate struct {
	// contains filtered or unexported fields
}

wrapper around a template which trims the output

func NewTrimmerTemplate

func NewTrimmerTemplate(template *template.Template) *TrimmerTemplate

Jump to

Keyboard shortcuts

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