diff options
-rw-r--r-- | ui/buffers.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ui/buffers.go b/ui/buffers.go index b11e734..3a17b18 100644 --- a/ui/buffers.go +++ b/ui/buffers.go @@ -42,6 +42,8 @@ type Line struct { splitPoints []point width int newLines []int + + HeadTag string } func (l *Line) IsZero() bool { @@ -388,6 +390,13 @@ func (bs *BufferList) AddLine(netID, title string, line Line) { } // TODO change b.scrollAmt if it's not 0 and bs.current is idx. } else { + if n != 0 { + l := &b.lines[n-1] + if l.Head == line.Head || l.HeadTag == line.Head { + line.HeadTag = line.Head + line.Head = "" + } + } line.computeSplitPoints() b.lines = append(b.lines, line) if b == current && 0 < b.scrollAmt { @@ -424,6 +433,13 @@ func (bs *BufferList) AddLines(netID, title string, before, after []Line) { } line.computeSplitPoints() } + if len(lines) > 0 { + l := &lines[len(lines)-1] + if l.Head == line.Head || l.HeadTag == line.Head { + line.HeadTag = line.Head + line.Head = "" + } + } lines = append(lines, line) } } |