mirror of
https://github.com/zyedidia/micro.git
synced 2026-02-21 14:30:24 +09:00
infopane: HandleEvent: reset key sequence when handling y/n prompt
Fix the following buggy behavior: 1. bind "<n><a>" to the Paste action in the command bar 2. open a split pane, type some text and press Ctrl-q to close it 3. answer "n" to the "Save changes before closing?" prompt 4. press Ctrl-e to open the command prompt and press "a" -> result: instead of inserting the "a" letter, clipboard is pasted.
This commit is contained in:
@@ -98,9 +98,15 @@ func (h *InfoPane) HandleEvent(event tcell.Event) {
|
||||
if (e.Rune() == 'y' || e.Rune() == 'Y') && hasYN {
|
||||
h.YNResp = true
|
||||
h.DonePrompt(false)
|
||||
|
||||
InfoBindings.ResetEvents()
|
||||
InfoBufBindings.ResetEvents()
|
||||
} else if (e.Rune() == 'n' || e.Rune() == 'N') && hasYN {
|
||||
h.YNResp = false
|
||||
h.DonePrompt(false)
|
||||
|
||||
InfoBindings.ResetEvents()
|
||||
InfoBufBindings.ResetEvents()
|
||||
}
|
||||
}
|
||||
if e.Key() == tcell.KeyRune && !done && !hasYN {
|
||||
|
||||
Reference in New Issue
Block a user