diff options
author | Drew DeVault <sir@cmpwn.com> | 2019-03-21 21:34:12 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-03-21 21:34:12 -0400 |
commit | e59122150932ae2cad32ab5881ed40ef0d722812 (patch) | |
tree | 036d3bc807bc6bbad4bda301c6de6d5897f9f976 /widgets/terminal.go | |
parent | a602891768d0272c8688731752f491eb92668d7d (diff) | |
download | aerc-e59122150932ae2cad32ab5881ed40ef0d722812.tar.gz |
Expire status errors on input
Diffstat (limited to 'widgets/terminal.go')
-rw-r--r-- | widgets/terminal.go | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/widgets/terminal.go b/widgets/terminal.go index 4a339cc..e7286f9 100644 --- a/widgets/terminal.go +++ b/widgets/terminal.go @@ -310,12 +310,14 @@ func (term *Terminal) Draw(ctx *ui.Context) { func (term *Terminal) Focus(focus bool) { term.focus = focus - if !term.focus { - term.ctx.HideCursor() - } else { - state := term.vterm.ObtainState() - row, col := state.GetCursorPos() - term.ctx.SetCursor(col, row) + if term.ctx != nil { + if !term.focus { + term.ctx.HideCursor() + } else { + state := term.vterm.ObtainState() + row, col := state.GetCursorPos() + term.ctx.SetCursor(col, row) + } } } |