summaryrefslogtreecommitdiffstats
path: root/pkg/gui
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-09-27 09:13:31 +1000
committerJesse Duffield <jessedduffield@gmail.com>2020-09-27 09:49:30 +1000
commit8a59a4404b85ed380111b9f07505ea4d3b2aaa12 (patch)
treeae5d54a907d5430f632d44cc78569c7046b05bc4 /pkg/gui
parent5724fa534aacdad4f73570794a4abaa7edbaf07d (diff)
rename prompt to input
Diffstat (limited to 'pkg/gui')
-rw-r--r--pkg/gui/custom_commands.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/pkg/gui/custom_commands.go b/pkg/gui/custom_commands.go
index 4a90661b1..391245578 100644
--- a/pkg/gui/custom_commands.go
+++ b/pkg/gui/custom_commands.go
@@ -5,8 +5,10 @@ import (
"log"
"text/template"
+ "github.com/fatih/color"
"github.com/jesseduffield/gocui"
"github.com/jesseduffield/lazygit/pkg/commands"
+ "github.com/jesseduffield/lazygit/pkg/utils"
)
type CustomCommandObjects struct {
@@ -92,7 +94,7 @@ func (gui *Gui) handleCustomCommandKeybinding(customCommand CustomCommand) func(
wrappedF := f
switch prompt.Type {
- case "prompt":
+ case "input":
f = func() error {
title, err := gui.resolveTemplate(prompt.Title, promptResponses)
if err != nil {
@@ -142,7 +144,7 @@ func (gui *Gui) handleCustomCommandKeybinding(customCommand CustomCommand) func(
}
menuItems[i] = &menuItem{
- displayStrings: []string{name, description},
+ displayStrings: []string{name, utils.ColoredString(description, color.FgYellow)},
onPress: func() error {
promptResponses[idx] = value
@@ -159,7 +161,7 @@ func (gui *Gui) handleCustomCommandKeybinding(customCommand CustomCommand) func(
return gui.createMenu(title, menuItems, createMenuOptions{showCancel: true})
}
default:
- return gui.createErrorPanel("custom command prompt must have a type of 'prompt' or 'menu'")
+ return gui.createErrorPanel("custom command prompt must have a type of 'input' or 'menu'")
}
}
@@ -175,7 +177,7 @@ type CustomCommandMenuOption struct {
}
type CustomCommandPrompt struct {
- Type string `yaml:"type"` // one of 'prompt' and 'menu'
+ Type string `yaml:"type"` // one of 'input' and 'menu'
Title string `yaml:"title"`
// this only apply to prompts