aerc

Working clone of aerc-mail.org
git clone git://git.danielmoch.com/aerc.git
Log | Files | Refs | README | LICENSE

commit a602891768d0272c8688731752f491eb92668d7d
parent 960d11c4bc2e8343f1369de43e2323ae1fcfb7c1
Author: Drew DeVault <sir@cmpwn.com>
Date:   Thu, 21 Mar 2019 21:28:51 -0400

term: don't mess with cursor when unfocused

Diffstat:
Mwidgets/terminal.go | 21+++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/widgets/terminal.go b/widgets/terminal.go @@ -297,17 +297,26 @@ func (term *Terminal) Draw(ctx *ui.Context) { } } - if !term.cursorShown { - ctx.HideCursor() - } else { - state := term.vterm.ObtainState() - row, col := state.GetCursorPos() - ctx.SetCursor(col, row) + if term.focus { + if !term.cursorShown { + ctx.HideCursor() + } else { + state := term.vterm.ObtainState() + row, col := state.GetCursorPos() + ctx.SetCursor(col, row) + } } } 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) + } } func convertMods(mods tcell.ModMask) vterm.Modifier {