From 73b64f2bf94a5be27e1feccb87cc95c4b7b8a08b Mon Sep 17 00:00:00 2001 From: Robin Jarry Date: Fri, 25 Mar 2022 09:27:20 +0100 Subject: [PATCH] completion: install panic handler in completion callback This callback is actually invoked in a goroutine by time.AfterFunc. The panic handler must be explicitly installed. Link: https://github.com/golang/go/blob/go1.18/src/time/sleep.go#L160-L173 Signed-off-by: Robin Jarry Acked-by: Moritz Poldrack --- lib/ui/textinput.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ui/textinput.go b/lib/ui/textinput.go index 59af7cc..aa15300 100644 --- a/lib/ui/textinput.go +++ b/lib/ui/textinput.go @@ -9,6 +9,7 @@ import ( "github.com/mattn/go-runewidth" "git.sr.ht/~rjarry/aerc/config" + "git.sr.ht/~rjarry/aerc/logging" ) // TODO: Attach history providers @@ -280,6 +281,7 @@ func (ti *TextInput) updateCompletions() { } if ti.completeDebouncer == nil { ti.completeDebouncer = time.AfterFunc(ti.completeDelay, func() { + defer logging.PanicHandler() ti.showCompletions() }) } else {