mirror of
https://github.com/zoriya/bubbles.git
synced 2026-08-05 12:46:14 +00:00
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:
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user