summaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ui/buffers.go17
-rw-r--r--ui/ui.go4
2 files changed, 14 insertions, 7 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,
+ })
+ }
}
diff --git a/ui/ui.go b/ui/ui.go
index bd9f6fa..c7ad49e 100644
--- a/ui/ui.go
+++ b/ui/ui.go
@@ -112,13 +112,13 @@ func (ui *UI) RemoveBuffer(title string) {
}
}
-func (ui *UI) AddLine(buffer string, line string, t time.Time) {
+func (ui *UI) AddLine(buffer string, line string, t time.Time, isStatus bool) {
idx := ui.bufferList.Idx(buffer)
if idx < 0 {
return
}
- ui.bufferList.AddLine(idx, line, t)
+ ui.bufferList.AddLine(idx, line, t, isStatus)
if idx == ui.bufferList.Current {
ui.drawBuffer()