aboutsummaryrefslogtreecommitdiffstats
path: root/lib/state/templates.go
diff options
context:
space:
mode:
authorJason Cox <me@jasoncarloscox.com>2024-02-29 22:21:30 -0500
committerRobin Jarry <robin@jarry.cc>2024-03-04 22:33:15 +0100
commit6a84f1331f1c18dccfbe58601a4243995ac5c7d2 (patch)
treebd99fb962ad5824b14aa8db82aed3c0b909c67d7 /lib/state/templates.go
parent2453375721832304b512380e6610de2c3d765bd5 (diff)
downloadaerc-6a84f1331f1c18dccfbe58601a4243995ac5c7d2.tar.gz
templates: add visual mode indicator to TrayInfo
It's useful to have some indicator of whether or not aerc is in visual mark mode. Add such an indicator to the TrayInfo available in the status line. Changelog-changed: The `TrayInfo` template variable now includes a visual mark mode indicator. Signed-off-by: Jason Cox <me@jasoncarloscox.com> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'lib/state/templates.go')
-rw-r--r--lib/state/templates.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/state/templates.go b/lib/state/templates.go
index e1570cd3..37767660 100644
--- a/lib/state/templates.go
+++ b/lib/state/templates.go
@@ -27,6 +27,7 @@ type DataSetter interface {
Data() models.TemplateData
SetHeaders(*mail.Header, *models.OriginalMail)
SetInfo(*models.MessageInfo, int, bool)
+ SetVisual(bool)
SetThreading(string, bool, int, int, bool, bool)
SetComposer(Composer)
SetAccount(*config.AccountConfig)
@@ -54,6 +55,7 @@ type templateData struct {
info *models.MessageInfo
marked bool
msgNum int
+ visual bool
// message list threading
threadInfo ThreadInfo
@@ -94,6 +96,10 @@ func (d *templateData) SetInfo(info *models.MessageInfo, num int, marked bool,
d.marked = marked
}
+func (d *templateData) SetVisual(visual bool) {
+ d.visual = visual
+}
+
func (d *templateData) SetThreading(prefix string, same bool, count int,
unread int, folded bool, context bool,
) {
@@ -624,6 +630,9 @@ func (d *templateData) TrayInfo() string {
if d.state.passthrough {
tray = append(tray, texter().Passthrough())
}
+ if d.visual {
+ tray = append(tray, texter().Visual())
+ }
return strings.Join(tray, config.Statusline.Separator)
}