mirror of
https://github.com/Maks1mS/bubbles.git
synced 2025-03-14 04:53:43 +03:00
Send newlines instead of cursor-downs in performance viewport
This commit is contained in:
parent
d095a6554c
commit
b82cf5071d
@ -1,11 +1,9 @@
|
|||||||
package viewport
|
package viewport
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
tea "github.com/charmbracelet/bubbletea"
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
te "github.com/muesli/termenv"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// MODEL
|
// MODEL
|
||||||
@ -324,8 +322,10 @@ func Update(msg tea.Msg, m Model) (Model, tea.Cmd) {
|
|||||||
func View(m Model) string {
|
func View(m Model) string {
|
||||||
|
|
||||||
if m.HighPerformanceRendering {
|
if m.HighPerformanceRendering {
|
||||||
// Skip over the area that would normally be rendered
|
// Just send newlines since we're doing to be rendering the actual
|
||||||
return fmt.Sprintf(te.CSI+te.CursorDownSeq, m.Height)
|
// 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 {
|
if m.Err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user