Skip to content

Commit

Permalink
Fix bug with wrapped strings and show size on expanded nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
antonmedv committed Mar 15, 2024
1 parent 47a9968 commit 4f7c802
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -732,8 +732,10 @@ func (m *model) View() string {
screen = append(screen, comma...)
}

if showSizes && n.isCollapsed() && (n.value[0] == '{' || n.value[0] == '[') {
screen = append(screen, currentTheme.Size([]byte(fmt.Sprintf(" // %d", n.size)))...)
if showSizes && len(n.value) > 0 && (n.value[0] == '{' || n.value[0] == '[') {
if n.isCollapsed() || n.size > 1 {
screen = append(screen, currentTheme.Size([]byte(fmt.Sprintf(" // %d", n.size)))...)
}
}

screen = append(screen, '\n')
Expand Down

0 comments on commit 4f7c802

Please sign in to comment.