aerc/lib/ui
Connor Kuehl 01528ae1e2 grid: don't draw at a negative offset
aerc panics when using macOS's default terminal emulator, Terminal.app,
when closing all but aerc's tab:

This error was also written to: /tmp/aerc-crash-20220427-194134.log
panic: Attempted to create context with negative offset [recovered]
	panic: Attempted to create context with negative offset

goroutine 1 [running]:
git.sr.ht/~rjarry/aerc/logging.PanicHandler()
	/Users/ckuehl/src/aerc/logging/panic-logger.go:47 +0x58c
panic({0x100d077a0, 0x14000032700})
	/opt/homebrew/Cellar/go/1.18.1/libexec/src/runtime/panic.go:844 +0x258
git.sr.ht/~rjarry/aerc/lib/ui.(*Context).Subcontext(0x1400013e420?, 0x14000202360?, 0x140000ffc48?, 0x1009a10e4?, 0x100da9440?)
	/Users/ckuehl/src/aerc/lib/ui/context.go:47 +0x160
git.sr.ht/~rjarry/aerc/lib/ui.(*Grid).Draw(0x1400013e420, 0x14000202360)
	/Users/ckuehl/src/aerc/lib/ui/grid.go:143 +0x2bc
git.sr.ht/~rjarry/aerc/widgets.(*Aerc).Draw(0x1400013e4d0, 0x14000202360)
	/Users/ckuehl/src/aerc/widgets/aerc.go:178 +0x30
git.sr.ht/~rjarry/aerc/lib/ui.(*UI).Tick(0x1400022bcc0)
	/Users/ckuehl/src/aerc/lib/ui/ui.go:116 +0x248
main.main()
	/Users/ckuehl/src/aerc/aerc.go:226 +0x9e8

I'm not entirely sure what the interactions are between the terminal
emulator, aerc's grid, and the space that moves around when the tab bar
disappears because there are no more tabs, but this fixes the issue 100%
of the time and I haven't noticed any issues.

Signed-off-by: Connor Kuehl <cipkuehl@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-04-28 17:56:37 +02:00
..
borders.go style: customize vertical and horizontal border characters 2021-11-30 15:05:33 +01:00
context.go update tcell to v2 and enable TrueColor support 2020-12-18 07:23:22 +01:00
fill.go view,compose: use border color to separate headers from body 2021-10-28 16:38:23 +02:00
grid.go grid: don't draw at a negative offset 2022-04-28 17:56:37 +02:00
interfaces.go update tcell to v2 and enable TrueColor support 2020-12-18 07:23:22 +01:00
invalidatable.go lib/ui: introduce Invalidatable 2019-04-27 14:30:28 -04:00
popover.go update tcell to v2 and enable TrueColor support 2020-12-18 07:23:22 +01:00
stack.go go.mod: change base git url 2021-11-05 10:21:45 +01:00
tab.go aerc: use contextual ui styleset for tabs/compose 2022-04-17 12:18:22 +02:00
text.go update tcell to v2 and enable TrueColor support 2020-12-18 07:23:22 +01:00
textinput.go completion: install panic handler in completion callback 2022-03-25 13:03:04 +01:00
ui.go logging: added a log on panic 2022-03-23 20:56:09 +01:00