Skip to content

Commit

Permalink
add help, unlimit suggestions and use more contrast on rendering
Browse files Browse the repository at this point in the history
Former-commit-id: 8a251d5
  • Loading branch information
isacikgoz committed Dec 25, 2018
1 parent 681df0b commit 199f0f3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pkg/config/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
func colorLogo() string {

cyan := color.New(color.FgCyan)
blue := color.New(color.FgBlue)
blue := color.New(color.FgHiBlue)
logo := cyan.Sprint(`
__ __ __
/ /_/ /___/ /____ __ __
Expand Down
2 changes: 1 addition & 1 deletion pkg/pages/pages.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var (
ext = ".md"

bold = color.New(color.Bold)
blue = color.New(color.FgBlue)
blue = color.New(color.FgHiBlue)
red = color.New(color.FgRed)
cyan = color.New(color.FgCyan)
white = color.New(color.FgWhite)
Expand Down
12 changes: 8 additions & 4 deletions pkg/prompt/prompt.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ func (p *Prompt) RenderPage(static bool) error {
{
Name: "Tip",
Prompt: &survey.Select{
Message: p.Page.Display() + "\n",
Options: options,
VimMode: true,
Message: p.Page.Display() + "\n",
Options: options,
VimMode: true,
PageSize: len(p.Page.Tips),
Help: "Select a command template to fill args.",
},
Validate: survey.Required,
},
Expand All @@ -63,14 +65,16 @@ func (p *Prompt) RenderPage(static bool) error {
{{- " "}}(Use{{" "}}{{- color "cyan"}}arrows{{- color "reset"}}` +
` to move,{{" "}}{{- color "cyan"}}type{{- color "reset"}} to filter or{{" "}}` +
`{{- color "red"}}ctrl+c{{- color "reset"}} to return{{- if and .Help (not .ShowHelp)}}` +
`, {{ HelpInputRune }} for more help{{end}})
`. {{""}}{{- color "green"}}{{ HelpInputRune }}{{- color "reset"}} for more{{end}})
{{- if .ShowHelp }}{{"\n"}}{{- color "green"}}{{ HelpIcon }}{{" "}}{{ .Help }}{{color "reset"}}{{end}}
{{- "\n\n"}}
{{- range $ix, $choice := .PageEntries}}
{{- if eq $ix $.SelectedIndex}}{{color "blue+b"}}{{ "-" }} {{else}}{{color "default"}} {{end}}
{{- $choice}}
{{- color "reset"}}{{"\n"}}
{{- end}}
{{- end}}`

terminal.InterruptErr = errors.New("\x0d")
return nil
}
Expand Down

0 comments on commit 199f0f3

Please sign in to comment.