diff --git a/nil_renderer.go b/nil_renderer.go index b8fce9c..cf9fc7a 100644 --- a/nil_renderer.go +++ b/nil_renderer.go @@ -5,5 +5,6 @@ type nilRenderer struct{} func (n nilRenderer) start() {} func (n nilRenderer) stop() {} func (n nilRenderer) write(v string) {} +func (n nilRenderer) repaint() {} func (n nilRenderer) altScreen() bool { return false } func (n nilRenderer) setAltScreen(v bool) {} diff --git a/renderer.go b/renderer.go index a62f8c0..47e9fb4 100644 --- a/renderer.go +++ b/renderer.go @@ -5,6 +5,7 @@ type renderer interface { start() stop() write(string) + repaint() altScreen() bool setAltScreen(bool) } diff --git a/standard_renderer.go b/standard_renderer.go index 0eda45b..a26dfe7 100644 --- a/standard_renderer.go +++ b/standard_renderer.go @@ -202,6 +202,10 @@ func (r *standardRenderer) write(s string) { _, _ = r.buf.WriteString(s) } +func (r *standardRenderer) repaint() { + r.lastRender = "" +} + func (r *standardRenderer) altScreen() bool { return r.altScreenActive } diff --git a/tea.go b/tea.go index b1dfe24..80d12b8 100644 --- a/tea.go +++ b/tea.go @@ -438,6 +438,9 @@ func (p *Program) Start() error { } continue + case WindowSizeMsg: + p.renderer.repaint() + case enterAltScreenMsg: p.EnterAltScreen()