Repository: jesseduffield/lazygit
File: pkg/config/user_config.go (Go)

Code before:
	// EditCommandTemplate is the command template for editing a file
	EditCommandTemplate string `yaml:"editCommandTemplate,omitempty"`

	// OpenCommand is the command for opening a file
	OpenCommand string `yaml:"openCommand,omitempty"`

	// OpenCommand is the command for opening a link
	OpenLinkCommand string `yaml:"openLinkCommand,omitempty"`
}

type CustomCommand struct {
	Key         string                `yaml:"key"`
	Context     string                `yaml:"context"`
	Command     string                `yaml:"command"`
	Subprocess  bool                  `yaml:"subprocess"`
	Prompts     []CustomCommandPrompt `yaml:"prompts"`
	LoadingText string                `yaml:"loadingText"`
	Description string                `yaml:"description"`
	Stream      bool                  `yaml:"stream"`
}

type CustomCommandPrompt struct {
	Type  string `yaml:"type"` // one of 'input', 'menu', or 'confirm'
	Title string `yaml:"title"`

	// this only apply to prompts
	InitialValue string `yaml:"initialValue"`

	// this only applies to confirm prompts
	Body string `yaml:"body"`

	// this only applies to menus
	Options []CustomCommandMenuOption

	// this only applies to menuFromCommand
	Command     string `yaml:"command"`
	Filter      string `yaml:"filter"`
	ValueFormat string `yaml:"valueFormat"`
	LabelFormat string `yaml:"labelFormat"`
}

type CustomCommandMenuOption struct {
	Name        string `yaml:"name"`
	Description string `yaml:"description"`
	Value       string `yaml:"value"`
}

func GetDefaultConfig() *UserConfig {
	return &UserConfig{
		Gui: GuiConfig{
			ScrollHeight:           2,

Review comment (suggestion):
```suggestion
	// this only apply to input prompts
```

Code after:
	// EditCommandTemplate is the command template for editing a file
	EditCommandTemplate string `yaml:"editCommandTemplate,omitempty"`

	// OpenCommand is the command for opening a file
	OpenCommand string `yaml:"openCommand,omitempty"`

	// OpenCommand is the command for opening a link
	OpenLinkCommand string `yaml:"openLinkCommand,omitempty"`
}

type CustomCommand struct {
	Key         string                `yaml:"key"`
	Context     string                `yaml:"context"`
	Command     string                `yaml:"command"`
	Subprocess  bool                  `yaml:"subprocess"`
	Prompts     []CustomCommandPrompt `yaml:"prompts"`
	LoadingText string                `yaml:"loadingText"`
	Description string                `yaml:"description"`
	Stream      bool                  `yaml:"stream"`
}

type CustomCommandPrompt struct {
	Type  string `yaml:"type"` // one of 'input', 'menu', or 'confirm'
	Title string `yaml:"title"`

	// this only apply to input prompts
	InitialValue string `yaml:"initialValue"`

	// this only applies to confirm prompts
	Body string `yaml:"body"`

	// this only applies to menus
	Options []CustomCommandMenuOption

	// this only applies to menuFromCommand
	Command     string `yaml:"command"`
	Filter      string `yaml:"filter"`
	ValueFormat string `yaml:"valueFormat"`
	LabelFormat string `yaml:"labelFormat"`
}

type CustomCommandMenuOption struct {
	Name        string `yaml:"name"`
	Description string `yaml:"description"`
	Value       string `yaml:"value"`
}

func GetDefaultConfig() *UserConfig {
	return &UserConfig{
		Gui: GuiConfig{
			ScrollHeight:           2,