From e780c6ee96ae086fc668aadcd61fb1777d1cbe43 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Fri, 15 Mar 2019 21:41:18 -0400 Subject: Implement :next-message n% --- widgets/msglist.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'widgets') diff --git a/widgets/msglist.go b/widgets/msglist.go index 0fb919d..cf9a772 100644 --- a/widgets/msglist.go +++ b/widgets/msglist.go @@ -13,6 +13,7 @@ import ( type MessageList struct { conf *config.AercConfig logger *log.Logger + height int onInvalidate func(d ui.Drawable) selected int spinner *Spinner @@ -45,6 +46,7 @@ func (ml *MessageList) Invalidate() { } func (ml *MessageList) Draw(ctx *ui.Context) { + ml.height = ctx.Height() ctx.Fill(0, 0, ctx.Width(), ctx.Height(), ' ', tcell.StyleDefault) if ml.store == nil { @@ -91,6 +93,10 @@ func (ml *MessageList) Draw(ctx *ui.Context) { } } +func (ml *MessageList) Height() int { + return ml.height +} + func (ml *MessageList) SetStore(store *lib.MessageStore) { ml.store = store if store != nil { -- cgit v1.2.3