refactor: switch to x/ansi for text manipulation (#505)

Need to be consistent with Lipgloss and https://github.com/charmbracelet/lipgloss/pull/279
This commit is contained in:
Ayman Bagabas
2024-05-23 15:13:44 -04:00
committed by GitHub
parent 3e827603f3
commit e1ea5dc528
4 changed files with 11 additions and 12 deletions
+2 -2
View File
@@ -10,8 +10,8 @@ import (
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/harmonica"
"github.com/charmbracelet/lipgloss"
"github.com/charmbracelet/x/ansi"
"github.com/lucasb-eyer/go-colorful"
"github.com/muesli/reflow/ansi"
"github.com/muesli/termenv"
)
@@ -283,7 +283,7 @@ func (m Model) View() string {
func (m Model) ViewAs(percent float64) string {
b := strings.Builder{}
percentView := m.percentageView(percent)
m.barView(&b, percent, ansi.PrintableRuneWidth(percentView))
m.barView(&b, percent, ansi.StringWidth(percentView))
b.WriteString(percentView)
return b.String()
}