From e61db7c3908c2538cce428e4c68376ffb5e3f53f Mon Sep 17 00:00:00 2001 From: embeddedc <> Date: Thu, 5 Feb 2026 16:52:15 +0100 Subject: [PATCH] Improve list paginator rendering performance --- paginator/paginator.go | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/paginator/paginator.go b/paginator/paginator.go index 12e4e9348..78e81bfd9 100644 --- a/paginator/paginator.go +++ b/paginator/paginator.go @@ -6,6 +6,7 @@ package paginator import ( "fmt" + "strings" "github.com/charmbracelet/bubbles/key" tea "github.com/charmbracelet/bubbletea" @@ -198,15 +199,9 @@ func (m Model) View() string { } func (m Model) dotsView() string { - var s string - for i := 0; i < m.TotalPages; i++ { - if i == m.Page { - s += m.ActiveDot - continue - } - s += m.InactiveDot - } - return s + return strings.Repeat(m.InactiveDot, m.Page) + + m.ActiveDot + + strings.Repeat(m.InactiveDot, m.TotalPages-m.Page-1) } func (m Model) arabicView() string {