Skip to content

Commit

Permalink
Update prompt string with a question mark
Browse files Browse the repository at this point in the history
  • Loading branch information
mkchoi212 committed Jan 6, 2018
1 parent 3114cf9 commit 5841577
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ p - [p]revious conflict
h | ? - [h]elp
q | Ctrl+c - [q]uit
[wasd] >> [INPUT HERE]
[w,a,s,d,?] >> [INPUT HERE]
```


Expand Down
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func parseInput(g *gocui.Gui, v *gocui.View) error {
case 'q':
globalQuit(g)
default:
PrintPrompt(g, color.Red(color.Regular, "[wasd] >>"))
PrintPrompt(g, color.Red(color.Regular, promptString))
consecutiveError++
if consecutiveError == 2 {
consecutiveError = 0
Expand All @@ -67,7 +67,7 @@ func parseInput(g *gocui.Gui, v *gocui.View) error {
return
}
consecutiveError = 0
PrintPrompt(g, color.Green(color.Regular, "[wasd] >>"))
PrintPrompt(g, color.Green(color.Regular, promptString))
}

in := strings.TrimSuffix(v.Buffer(), "\n")
Expand All @@ -77,7 +77,7 @@ func parseInput(g *gocui.Gui, v *gocui.View) error {
if len(in) > 1 {
for _, r := range [...]rune{'a', 'd', 'h', 'z'} {
if strings.ContainsRune(in, r) {
PrintPrompt(g, color.Red(color.Regular, "[wasd] >>"))
PrintPrompt(g, color.Red(color.Regular, promptString))
return nil
}
}
Expand Down
2 changes: 2 additions & 0 deletions prompt.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
"github.com/jroimartin/gocui"
)

var promptString = "[w,a,s,d,?] >>"

func promptEditor(v *gocui.View, key gocui.Key, ch rune, mod gocui.Modifier) {
switch {
case ch != 0 && mod == 0:
Expand Down

0 comments on commit 5841577

Please sign in to comment.