Skip to content

Commit 5b3737f

Browse files
committed
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.
1 parent 36bf3f6 commit 5b3737f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

internal/action/infopane.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,15 @@ func (h *InfoPane) HandleEvent(event tcell.Event) {
9898
if (e.Rune() == 'y' || e.Rune() == 'Y') && hasYN {
9999
h.YNResp = true
100100
h.DonePrompt(false)
101+
102+
InfoBindings.ResetEvents()
103+
InfoBufBindings.ResetEvents()
101104
} else if (e.Rune() == 'n' || e.Rune() == 'N') && hasYN {
102105
h.YNResp = false
103106
h.DonePrompt(false)
107+
108+
InfoBindings.ResetEvents()
109+
InfoBufBindings.ResetEvents()
104110
}
105111
}
106112
if e.Key() == tcell.KeyRune && !done && !hasYN {

0 commit comments

Comments
 (0)