Fix bug with wrapped strings and show size on expanded nodes

pull/297/head
Anton Medvedev 2 months ago
parent 47a996835e
commit 4f7c802534
No known key found for this signature in database

@ -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')

Loading…
Cancel
Save