Skip to content

Commit

Permalink
Revert "fix: calculate offset from previous field heights"
Browse files Browse the repository at this point in the history
This reverts commit b41c5e7.
  • Loading branch information
bashbunni committed Nov 27, 2024
1 parent 682d2c7 commit f8b3922
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions group.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,18 +296,18 @@ func (g *Group) fullHeight() int {

func (g *Group) getContent() (int, string) {
var fields strings.Builder
var offset int
offset := 0
gap := "\n\n"

// If the focused field is requesting it be zoomed, only show that field.
// if the focused field is requesting it be zoomed, only show that field.
if g.selector.Selected().Zoom() {
g.selector.Selected().WithHeight(g.height - 1)
fields.WriteString(g.selector.Selected().View())
} else {
g.selector.Range(func(i int, field Field) bool {
fields.WriteString(field.View())
// Set the offset to the height of the previous field(s).
if i < g.selector.Index() {
offset += lipgloss.Height(field.View())
if i == g.selector.Index() {
offset = lipgloss.Height(fields.String()) - lipgloss.Height(field.View())
}
if i < g.selector.Total()-1 {
fields.WriteString(gap)
Expand Down

0 comments on commit f8b3922

Please sign in to comment.