aboutsummaryrefslogtreecommitdiffstats
path: root/lib/marker
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/marker
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/marker')
-rw-r--r--lib/marker/marker.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/marker/marker.go b/lib/marker/marker.go
index 21c151f3..a0860be9 100644
--- a/lib/marker/marker.go
+++ b/lib/marker/marker.go
@@ -8,6 +8,7 @@ type Marker interface {
Remark()
Marked() []uint32
IsMarked(uint32) bool
+ IsVisualMark() bool
ToggleVisualMark(bool)
UpdateVisualMark()
ClearVisualMark()
@@ -114,6 +115,11 @@ func (mc *controller) Marked() []uint32 {
return marked
}
+// IsVisualMark indicates whether visual marking mode is enabled.
+func (mc *controller) IsVisualMark() bool {
+ return mc.visualMarkMode
+}
+
// ToggleVisualMark enters or leaves the visual marking mode
func (mc *controller) ToggleVisualMark(clear bool) {
mc.visualMarkMode = !mc.visualMarkMode