Skip to content

Commit 199f0f3

Browse files
committedDec 25, 2018
add help, unlimit suggestions and use more contrast on rendering
Former-commit-id: 8a251d5
1 parent 681df0b commit 199f0f3

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed
 

‎pkg/config/messages.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
func colorLogo() string {
88

99
cyan := color.New(color.FgCyan)
10-
blue := color.New(color.FgBlue)
10+
blue := color.New(color.FgHiBlue)
1111
logo := cyan.Sprint(`
1212
__ __ __
1313
/ /_/ /___/ /____ __ __

‎pkg/pages/pages.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ var (
1818
ext = ".md"
1919

2020
bold = color.New(color.Bold)
21-
blue = color.New(color.FgBlue)
21+
blue = color.New(color.FgHiBlue)
2222
red = color.New(color.FgRed)
2323
cyan = color.New(color.FgCyan)
2424
white = color.New(color.FgWhite)

‎pkg/prompt/prompt.go

+8-4
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,11 @@ func (p *Prompt) RenderPage(static bool) error {
4242
{
4343
Name: "Tip",
4444
Prompt: &survey.Select{
45-
Message: p.Page.Display() + "\n",
46-
Options: options,
47-
VimMode: true,
45+
Message: p.Page.Display() + "\n",
46+
Options: options,
47+
VimMode: true,
48+
PageSize: len(p.Page.Tips),
49+
Help: "Select a command template to fill args.",
4850
},
4951
Validate: survey.Required,
5052
},
@@ -63,14 +65,16 @@ func (p *Prompt) RenderPage(static bool) error {
6365
{{- " "}}(Use{{" "}}{{- color "cyan"}}arrows{{- color "reset"}}` +
6466
` to move,{{" "}}{{- color "cyan"}}type{{- color "reset"}} to filter or{{" "}}` +
6567
`{{- color "red"}}ctrl+c{{- color "reset"}} to return{{- if and .Help (not .ShowHelp)}}` +
66-
`, {{ HelpInputRune }} for more help{{end}})
68+
`. {{""}}{{- color "green"}}{{ HelpInputRune }}{{- color "reset"}} for more{{end}})
69+
{{- if .ShowHelp }}{{"\n"}}{{- color "green"}}{{ HelpIcon }}{{" "}}{{ .Help }}{{color "reset"}}{{end}}
6770
{{- "\n\n"}}
6871
{{- range $ix, $choice := .PageEntries}}
6972
{{- if eq $ix $.SelectedIndex}}{{color "blue+b"}}{{ "-" }} {{else}}{{color "default"}} {{end}}
7073
{{- $choice}}
7174
{{- color "reset"}}{{"\n"}}
7275
{{- end}}
7376
{{- end}}`
77+
7478
terminal.InterruptErr = errors.New("\x0d")
7579
return nil
7680
}

0 commit comments

Comments
 (0)
Please sign in to comment.