Expire status errors on input
This commit is contained in:
parent
a602891768
commit
e591221509
3 changed files with 21 additions and 6 deletions
|
@ -124,6 +124,7 @@ func (aerc *Aerc) Event(event tcell.Event) bool {
|
|||
|
||||
switch event := event.(type) {
|
||||
case *tcell.EventKey:
|
||||
aerc.statusline.Expire()
|
||||
aerc.pendingKeys = append(aerc.pendingKeys, config.KeyStroke{
|
||||
Key: event.Key(),
|
||||
Rune: event.Rune(),
|
||||
|
@ -231,8 +232,16 @@ func (aerc *Aerc) focus(item libui.Interactive) {
|
|||
aerc.focused.Focus(false)
|
||||
}
|
||||
aerc.focused = item
|
||||
interactive, ok := aerc.tabs.Tabs[aerc.tabs.Selected].Content.(ui.Interactive)
|
||||
if item != nil {
|
||||
item.Focus(true)
|
||||
if ok {
|
||||
interactive.Focus(false)
|
||||
}
|
||||
} else {
|
||||
if ok {
|
||||
interactive.Focus(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -81,6 +81,10 @@ func (status *StatusLine) Push(text string, expiry time.Duration) *StatusMessage
|
|||
return msg
|
||||
}
|
||||
|
||||
func (status *StatusLine) Expire() {
|
||||
status.stack = nil
|
||||
}
|
||||
|
||||
func (msg *StatusMessage) Color(bg tcell.Color, fg tcell.Color) {
|
||||
msg.bg = bg
|
||||
msg.fg = fg
|
||||
|
|
|
@ -310,6 +310,7 @@ func (term *Terminal) Draw(ctx *ui.Context) {
|
|||
|
||||
func (term *Terminal) Focus(focus bool) {
|
||||
term.focus = focus
|
||||
if term.ctx != nil {
|
||||
if !term.focus {
|
||||
term.ctx.HideCursor()
|
||||
} else {
|
||||
|
@ -317,6 +318,7 @@ func (term *Terminal) Focus(focus bool) {
|
|||
row, col := state.GetCursorPos()
|
||||
term.ctx.SetCursor(col, row)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func convertMods(mods tcell.ModMask) vterm.Modifier {
|
||||
|
|
Loading…
Reference in a new issue