diff options
author | Robin Jarry <robin@jarry.cc> | 2022-03-25 09:27:20 +0100 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-03-25 13:03:04 +0100 |
commit | 73b64f2bf94a5be27e1feccb87cc95c4b7b8a08b (patch) | |
tree | bb3feb94196639e69a3ebeba8c634286496b1ebb /lib/ui/textinput.go | |
parent | 037676f7ccdd1ec00a3328ee7062000d5b8aab51 (diff) | |
download | aerc-73b64f2bf94a5be27e1feccb87cc95c4b7b8a08b.tar.gz |
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/ui/textinput.go')
-rw-r--r-- | lib/ui/textinput.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/ui/textinput.go b/lib/ui/textinput.go index 59af7cc8..aa153002 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 { |