1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-08-07 22:02:56 +03:00

feat: add confirm prompt for custom keybindings

- Supports configuring a custom confirmation prompt via `config.yml` for
  custom keybindings. A new `CustomCommandPrompt.Body` field is
  used to store the immutable body text of the confirmation popup.
- Adds a sample 'confirm' prompt to the example `config.yml`.
- Updates the `Prompts` section of the documentation to include
  'confirm' prompt type and also describe which fields pertain to it
  (i.e. `initialValue`).

Closes: https://github.com/jesseduffield/lazygit/issues/1858

Signed-off-by: Michael Mead <mmead.developer@gmail.com>
This commit is contained in:
Michael Mead
2022-06-24 22:37:10 -07:00
parent 582b1991a4
commit 9d304098bb
4 changed files with 38 additions and 10 deletions

View File

@@ -313,12 +313,15 @@ type CustomCommand struct {
}
type CustomCommandPrompt struct {
Type string `yaml:"type"` // one of 'input' and 'menu'
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