Skip to content

Commit 29b7f55

Browse files
committed
chore: rebase
1 parent 50223fd commit 29b7f55

6 files changed

Lines changed: 15 additions & 15 deletions

File tree

examples/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@ require (
4747
golang.org/x/text v0.24.0 // indirect
4848
)
4949

50-
replace charm.land/lipgloss/v2 v2.0.0-beta.3.0.20251205162909-7869489d8971 => ../../lipgloss
50+
replace charm.land/lipgloss/v2 v2.0.0 => ../../lipgloss
5151

5252
replace charm.land/bubbles/v2 v2.0.0-beta.1.0.20251110211018-84a82dfeeed8 => ../../bubbles

examples/go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
charm.land/lipgloss/v2 v2.0.0 h1:sd8N/B3x892oiOjFfBQdXBQp3cAkvjGaU5TvVZC3ivo=
2-
charm.land/lipgloss/v2 v2.0.0/go.mod h1:w6SnmsBFBmEFBodiEDurGS/sdUY/u1+v72DqUzc6J14=
31
github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ=
42
github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE=
53
github.com/alecthomas/assert/v2 v2.7.0 h1:QtqSACNS3tF7oasA8CU6A6sXZSBDqnm7RfpLl9bZqbE=

examples/tree-default/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
2929
return m, cmd
3030
}
3131

32-
func (m model) View() string {
33-
return m.tree.View()
32+
func (m model) View() tea.View {
33+
return tea.NewView(m.tree.View())
3434
}
3535

3636
func main() {

examples/tree-file-system/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ func (m *model) updateStyles() {
5959
})
6060
}
6161

62-
func (m model) View() string {
63-
return m.tree.View()
62+
func (m model) View() tea.View {
63+
return tea.NewView(m.tree.View())
6464
}
6565

6666
type file struct {

examples/tree-long/main.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
3131
return m, cmd
3232
}
3333

34-
func (m model) View() string {
35-
return m.tree.View()
34+
func (m model) View() tea.View {
35+
return tea.NewView(m.tree.View())
3636
}
3737

3838
func main() {
@@ -41,7 +41,8 @@ func main() {
4141
for year := thisYear; year < thisYear+10; year++ {
4242
yRoot := tree.Root(fmt.Sprintf("%d", year)).Close()
4343
for month := 1; month <= 12; month++ {
44-
mRoot := tree.Root(time.Month(month).String()).Close().RootStyle(lipgloss.NewStyle().Foreground(lipgloss.Color("1")))
44+
mRoot := tree.Root(time.Month(month).String()).Close().RootStyle(
45+
lipgloss.NewStyle().Foreground(lipgloss.Color("1")))
4546
for day := 1; day < daysIn(time.Month(month), year); day++ {
4647
mRoot.Child(fmt.Sprintf("%d", day))
4748
}

examples/tree-toc/main.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func (m *model) updateStyles() {
4242
})
4343
}
4444

45-
func (m model) View() string {
45+
func (m model) View() tea.View {
4646
pageNumbers := make([]string, len(m.tree.AllNodes()))
4747
for i, node := range m.tree.AllNodes() {
4848
v := node.GivenValue()
@@ -56,18 +56,19 @@ func (m model) View() string {
5656
pageNumbers[i] = num
5757
}
5858
}
59-
return lipgloss.NewStyle().Padding(1).Render(
59+
v := lipgloss.NewStyle().Padding(1).Render(
6060
lipgloss.JoinHorizontal(
6161
lipgloss.Top,
6262
m.tree.View(),
6363
lipgloss.JoinVertical(lipgloss.Left, pageNumbers...)),
6464
)
65+
66+
return tea.NewView(v)
6567
}
6668

6769
const (
68-
width = 60
69-
height = 12
70-
enumeratorWidth = 3
70+
width = 60
71+
height = 12
7172
)
7273

7374
func enumerator(_ ltree.Children, _ int) string {

0 commit comments

Comments
 (0)