diff options
| author | citrons <citrons@mondecitronne.com> | 2025-05-31 17:16:38 -0500 |
|---|---|---|
| committer | citrons <citrons@mondecitronne.com> | 2025-05-31 17:16:57 -0500 |
| commit | b11c892158772f508e494b2726a5d4db1bb74d23 (patch) | |
| tree | 16113353422520259ccc7937e9085a68ac6663a6 /client/buffer | |
| parent | 0a58e68ad438ff43fa5bbecdb8914aa00cab5099 (diff) | |
text input box
Diffstat (limited to 'client/buffer')
| -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() } |
