From 5b3737fb2abb9329fd2fa2608d566d8cd245470c Mon Sep 17 00:00:00 2001 From: Dmytro Maluka Date: Thu, 25 Apr 2024 00:05:27 +0200 Subject: [PATCH] infopane: HandleEvent: reset key sequence when handling y/n prompt Fix the following buggy behavior: 1. bind "" 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. --- internal/action/infopane.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/action/infopane.go b/internal/action/infopane.go index 32afb8d8..321fb45b 100644 --- a/internal/action/infopane.go +++ b/internal/action/infopane.go @@ -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 {