From b82cf5071dd38b8556fe8214efb90cdcab195db6 Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Thu, 18 Jun 2020 18:31:30 -0400 Subject: [PATCH] Send newlines instead of cursor-downs in performance viewport --- viewport/viewport.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/viewport/viewport.go b/viewport/viewport.go index c8186db..1d9b07f 100644 --- a/viewport/viewport.go +++ b/viewport/viewport.go @@ -1,11 +1,9 @@ package viewport import ( - "fmt" "strings" tea "github.com/charmbracelet/bubbletea" - te "github.com/muesli/termenv" ) // MODEL @@ -324,8 +322,10 @@ func Update(msg tea.Msg, m Model) (Model, tea.Cmd) { func View(m Model) string { if m.HighPerformanceRendering { - // Skip over the area that would normally be rendered - return fmt.Sprintf(te.CSI+te.CursorDownSeq, m.Height) + // Just send newlines since we're doing to be rendering the actual + // content seprately. We do need to send something so that the Bubble + // Tea standard renderer can push everything else down. + return strings.Repeat("\n", m.Height-1) } if m.Err != nil {