Skip to content
Myr

chore(examples): remove performance rendering portion of pager example

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Christian Rocha · committed by Christian Rocha · parent cfef822 · Browse files · 1 file+0 added−23 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+0 added−23 removed

  • other:+0 added−23 removed

1 file+0 added−23 removed

modified:examples/pager/main.go-23 removed
11 unmodified lines
12 tea "github.com/charmbracelet/bubbletea"13 "github.com/charmbracelet/lipgloss"14)1516// You generally won't need this unless you're processing stuff with17// complicated ANSI escape sequences. Turn it on if you notice flickering.18//19// Also keep in mind that high performance rendering only works for programs20// that use the full size of the terminal. We're enabling that below with21// tea.EnterAltScreen().22const useHighPerformanceRenderer = false2316var (17 titleStyle = func() lipgloss.Style {18 b := lipgloss.RoundedBorder()19 b.Right = "├"
41 unmodified lines
61 // quickly, though asynchronously, which is why we wait for them62 // here.63 m.viewport = viewport.New(msg.Width, msg.Height-verticalMarginHeight)64 m.viewport.YPosition = headerHeight73 m.viewport.HighPerformanceRendering = useHighPerformanceRenderer65 m.viewport.SetContent(m.content)66 m.ready = true7677 // This is only necessary for high performance rendering, which in78 // most cases you won't need.79 //80 // Render the viewport one line below the header.81 m.viewport.YPosition = headerHeight + 167 } else {68 m.viewport.Width = msg.Width69 m.viewport.Height = msg.Height - verticalMarginHeight70 }8687 if useHighPerformanceRenderer {88 // Render (or re-render) the whole viewport. Necessary both to89 // initialize the viewport and when the window is resized.90 //91 // This is needed for high-performance rendering only.92 cmds = append(cmds, viewport.Sync(m.viewport))93 }71 }7273 // Handle keyboard and mouse events in the viewport74 m.viewport, cmd = m.viewport.Update(msg)
50 unmodified lines