summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2022-03-25 09:27:20 +0100
committerRobin Jarry <robin@jarry.cc>2022-03-25 13:03:04 +0100
commit73b64f2bf94a5be27e1feccb87cc95c4b7b8a08b (patch)
treebb3feb94196639e69a3ebeba8c634286496b1ebb /lib
parent037676f7ccdd1ec00a3328ee7062000d5b8aab51 (diff)
downloadaerc-73b64f2bf94a5be27e1feccb87cc95c4b7b8a08b.zip
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 <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
Diffstat (limited to 'lib')
-rw-r--r--lib/ui/textinput.go2
1 files changed, 2 insertions, 0 deletions
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 {