Skip to content

Commit

Permalink
Print help when user has no idea what he/she is doing
Browse files Browse the repository at this point in the history
  • Loading branch information
mkchoi212 committed Dec 30, 2017
1 parent d04835e commit f153931
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ var (
cur = 0
conflictCount = 0
conflicts = []Conflict{}

consecutiveError = 0
)

func printLines(v *gocui.View, lines []string) {
Expand Down Expand Up @@ -51,8 +53,12 @@ func parseInput(g *gocui.Gui, v *gocui.View) error {
globalQuit(g)
default:
printPrompt(g, Red(Regular, "[wasd] >>"))
consecutiveError++
}
if consecutiveError == 2 {
consecutiveError = 0
conflicts[cur].Select(g, true)
}
printPrompt(g, Green(Regular, "[wasd] >>"))
}

in := strings.TrimSuffix(v.Buffer(), "\n")
Expand Down
2 changes: 1 addition & 1 deletion summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func printHelp(v *gocui.View) {
h | ? - print help
q | Ctrl+c - quit
`
fmt.Fprintf(v, Black(Regular, instruction))
fmt.Fprintf(v, Blue(Regular, instruction))
}

func printSummary() {
Expand Down

0 comments on commit f153931

Please sign in to comment.