aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTim Culverhouse <tim@timculverhouse.com>2024-02-12 06:26:14 -0600
committerRobin Jarry <robin@jarry.cc>2024-02-12 13:47:29 +0100
commit4e26faf498b84b90ecd1af3bd6c6e1f2f3e44a6e (patch)
tree8e04d288683b220080cbae64e420e4e839c6c66d /lib
parent0ef4717b2a0fad1ee0a6426efa77325affaf566b (diff)
downloadaerc-4e26faf498b84b90ecd1af3bd6c6e1f2f3e44a6e.tar.gz
aerc-4e26faf498b84b90ecd1af3bd6c6e1f2f3e44a6e.zip
msgviewer: implement inline image viewing
Implement inline image viewing for jpeg, png, bmp, tiff, and webp formats. When a user has no configured image filter and the image is supported and the terminal has either sixel or kitty image protocol support, the image will be displayed in the message viewer. Always clear the screen before each draw. This call is necessary in vaxis to allow for images to be cleared properly between renders. There is no performance impact: the call only resets each cell to a blank cell, and aerc will redraw each one already. Changelog-added: Inline image previews when no filter is defined for `image/*` and the terminal supports it. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'lib')
-rw-r--r--lib/ui/ui.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/ui/ui.go b/lib/ui/ui.go
index b5c66530..b8030949 100644
--- a/lib/ui/ui.go
+++ b/lib/ui/ui.go
@@ -123,6 +123,7 @@ func Close() {
func Render() {
if atomic.SwapUint32(&state.dirty, 0) != 0 {
+ state.screen.Clear()
// reset popover for the next Draw
state.popover = nil
state.content.Draw(state.ctx)