mirror of
https://github.com/Hopiu/micro.git
synced 2026-03-21 16:30:24 +00:00
Fix YesNoPrompt bug
This commit is contained in:
parent
a8feef3c12
commit
cf3ce29a08
1 changed files with 3 additions and 0 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue