Fix YesNoPrompt bug

This commit is contained in:
Zachary Yedidia
2016-09-04 18:27:11 -04:00
parent a8feef3c12
commit cf3ce29a08

View File

@@ -114,11 +114,14 @@ func (m *Messenger) YesNoPrompt(prompt string) (bool, bool) {
switch e.Key() {
case tcell.KeyRune:
if e.Rune() == 'y' {
m.hasPrompt = false
return true, false
} else if e.Rune() == 'n' {
m.hasPrompt = false
return false, false
}
case tcell.KeyCtrlC, tcell.KeyCtrlQ, tcell.KeyEscape:
m.hasPrompt = false
return false, true
}
}