diff options
Diffstat (limited to 'widgets/status.go')
-rw-r--r-- | widgets/status.go | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/widgets/status.go b/widgets/status.go index c70d215f..960f2445 100644 --- a/widgets/status.go +++ b/widgets/status.go @@ -14,6 +14,7 @@ type StatusLine struct { ui.Invalidatable stack []*StatusMessage fallback StatusMessage + extra string aerc *Aerc uiConfig config.UIConfig } @@ -29,6 +30,7 @@ func NewStatusLine(uiConfig config.UIConfig) *StatusLine { style: uiConfig.GetStyle(config.STYLE_STATUSLINE_DEFAULT), message: "Idle", }, + extra: "", uiConfig: uiConfig, } } @@ -49,7 +51,11 @@ func (status *StatusLine) Draw(ctx *ui.Context) { pendingKeys += string(pendingKey.Rune) } } - message := runewidth.FillRight(line.message, ctx.Width()-len(pendingKeys)-5) + text := line.message + if status.extra != "" { + text += " " + status.extra + } + message := runewidth.FillRight(text, ctx.Width()-len(pendingKeys)-5) ctx.Printf(0, 0, line.style, "%s%s", message, pendingKeys) } @@ -103,6 +109,14 @@ func (status *StatusLine) PushSuccess(text string) *StatusMessage { return msg } +func (status *StatusLine) SetExtra(text string) { + status.extra = text +} + +func (status *StatusLine) ClearExtra() { + status.extra = "" +} + func (status *StatusLine) Expire() { status.stack = nil } |