aerc

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

commit 2925bdfd6c55de5e20cec9f689708d97855a1d08
parent 3cd0d5bc284985703a3eb1c2eae3c14a28f7200b
Author: Drew DeVault <sir@cmpwn.com>
Date:   Mon, 15 Apr 2019 16:07:05 -0400

Re-render terminal on invalidate

Diffstat:
Mwidgets/terminal.go | 17+++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/widgets/terminal.go b/widgets/terminal.go @@ -134,7 +134,7 @@ func NewTerminal(cmd *exec.Cmd) (*Terminal, error) { } screen.Flush() term.flushTerminal() - term.Invalidate() + term.invalidate() } }() screen.OnDamage = term.onDamage @@ -230,6 +230,15 @@ func (term *Terminal) OnInvalidate(cb func(d ui.Drawable)) { } func (term *Terminal) Invalidate() { + if term.vterm != nil { + width, height := term.vterm.Size() + rect := vterm.NewRect(0, width, 0, height) + term.damage = append(term.damage, *rect) + } + term.invalidate() +} + +func (term *Terminal) invalidate() { if term.onInvalidate != nil { term.onInvalidate(term) } @@ -415,7 +424,7 @@ func (term *Terminal) styleFromCell(cell *vterm.ScreenCell) tcell.Style { func (term *Terminal) onDamage(rect *vterm.Rect) int { term.damage = append(term.damage, *rect) - term.Invalidate() + term.invalidate() return 1 } @@ -428,7 +437,7 @@ func (term *Terminal) onMoveCursor(old *vterm.Pos, } term.cursorPos = *pos - term.Invalidate() + term.invalidate() return 1 } @@ -440,7 +449,7 @@ func (term *Terminal) onSetTermProp(prop int, val *vterm.VTermValue) int { } case vterm.VTERM_PROP_CURSORVISIBLE: term.cursorShown = val.Boolean - term.Invalidate() + term.invalidate() } return 1 }