summaryrefslogtreecommitdiff
path: root/ui/buffers.go
diff options
context:
space:
mode:
authorHubert Hirtz <hubert.hirtz@laposte.net>2020-06-03 23:05:44 +0200
committerHubert Hirtz <hubert.hirtz@laposte.net>2020-06-03 23:05:44 +0200
commit31b8f90aa0c75f52d03db7ca9fba41bddb8429fa (patch)
tree1db2ad54aedfafe8a50fd0fff56fdfa5cab3933a /ui/buffers.go
parentNick colors (diff)
Show JOIN and PARTs
Diffstat (limited to '')
-rw-r--r--ui/buffers.go17
1 files changed, 12 insertions, 5 deletions
diff --git a/ui/buffers.go b/ui/buffers.go
index 4caadf3..8ab5b44 100644
--- a/ui/buffers.go
+++ b/ui/buffers.go
@@ -99,9 +99,16 @@ func (bs *BufferList) Idx(title string) (idx int) {
return
}
-func (bs *BufferList) AddLine(idx int, line string, t time.Time) {
- bs.List[idx].Content = append(bs.List[idx].Content, Line{
- Time: t,
- Content: line,
- })
+func (bs *BufferList) AddLine(idx int, line string, t time.Time, isStatus bool) {
+ n := len(bs.List[idx].Content)
+
+ if isStatus && n != 0 && bs.List[idx].Content[n-1].IsStatus {
+ bs.List[idx].Content[n-1].Content += " " + line
+ } else {
+ bs.List[idx].Content = append(bs.List[idx].Content, Line{
+ Time: t,
+ IsStatus: isStatus,
+ Content: line,
+ })
+ }
}