Skip to content

Commit

Permalink
feat: remove FullWidth helper (not needed)
Browse files Browse the repository at this point in the history
  • Loading branch information
bashbunni committed Nov 26, 2024
1 parent 75664f1 commit 70db481
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions group.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ func (g *Group) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
switch msg := msg.(type) {
case tea.WindowSizeMsg:
g.WithHeight(min(g.fullHeight(), msg.Height-1))
g.WithWidth(min(g.fullWidth(), msg.Width-1))
g.WithWidth(msg.Width)
case nextFieldMsg:
cmds = append(cmds, g.nextField()...)
case prevFieldMsg:
Expand All @@ -291,16 +291,6 @@ func (g *Group) fullHeight() int {
return height
}

// width returns the full width of the group.
func (g *Group) fullWidth() int {
width := g.selector.Total()
g.selector.Range(func(_ int, field Field) bool {
width += lipgloss.Width(field.View())
return true
})
return width
}

func (g *Group) getContent() (int, string) {
var fields strings.Builder
var offset int
Expand Down

0 comments on commit 70db481

Please sign in to comment.