summaryrefslogtreecommitdiff
path: root/ui/buffers.go
diff options
context:
space:
mode:
Diffstat (limited to 'ui/buffers.go')
-rw-r--r--ui/buffers.go14
1 files changed, 11 insertions, 3 deletions
diff --git a/ui/buffers.go b/ui/buffers.go
index 6de3923..4726447 100644
--- a/ui/buffers.go
+++ b/ui/buffers.go
@@ -16,6 +16,14 @@ type point struct {
Split bool
}
+type NotifyType int
+
+const (
+ NotifyNone NotifyType = iota
+ NotifyUnread
+ NotifyHighlight
+)
+
type Line struct {
At time.Time
Head string
@@ -251,7 +259,7 @@ func (bs *BufferList) Remove(title string) (ok bool) {
return
}
-func (bs *BufferList) AddLine(title string, highlight bool, line Line) {
+func (bs *BufferList) AddLine(title string, notify NotifyType, line Line) {
idx := bs.idx(title)
if idx < 0 {
return
@@ -280,10 +288,10 @@ func (bs *BufferList) AddLine(title string, highlight bool, line Line) {
}
}
- if !line.Mergeable && idx != bs.current {
+ if notify != NotifyNone && idx != bs.current {
b.unread = true
}
- if highlight && idx != bs.current {
+ if notify == NotifyHighlight && idx != bs.current {
b.highlights++
}
}