diff options
Diffstat (limited to 'client/buffer/buffer.go')
| -rw-r--r-- | client/buffer/buffer.go | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/client/buffer/buffer.go b/client/buffer/buffer.go index bb782fb..230fba9 100644 --- a/client/buffer/buffer.go +++ b/client/buffer/buffer.go @@ -5,10 +5,10 @@ import ( ) type Buffer struct { - id string top *bufList bottom *bufList scroll tui.ScrollState + TextInput tui.TextInput Closed bool } @@ -24,10 +24,6 @@ type bufList struct { next *bufList } -func New(id string) Buffer { - return Buffer {id: id} -} - func (b *Buffer) Add(msg Message) { l := &bufList {msg: msg} if b.bottom != nil { @@ -70,8 +66,8 @@ func (b *Buffer) AtTop() bool { return b.scroll.AtLast() } -func (b *Buffer) Show() (atTop bool) { - tui.Push(b.id, tui.Box { +func (b *Buffer) Show(id string) (atTop bool) { + tui.Push(id, tui.Box { Width: tui.Fill, Height: tui.Fill, Dir: tui.Up, Overflow: true, Scroll: &b.scroll, }) @@ -90,5 +86,5 @@ func (b *Buffer) Show() (atTop bool) { tui.Pop() } - return atTop + return b.scroll.AtLast() } |
