summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorewy <ewy0@protonmail.com>2026-06-06 17:47:46 +0200
committerewy <ewy0@protonmail.com>2026-06-06 17:47:46 +0200
commit3795bc715f1f7c054177a2c04bddb08f2eb925cf (patch)
treec3f9259d1e9243ce83f701d7fb83698a19d3e226
parent52a527705ad474feb130f7837d7e781765750e34 (diff)
fix negative padding causing panic
-rw-r--r--indexers/pikdex/meta.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/indexers/pikdex/meta.go b/indexers/pikdex/meta.go
index 3eb182f..55cad86 100644
--- a/indexers/pikdex/meta.go
+++ b/indexers/pikdex/meta.go
@@ -38,7 +38,9 @@ var MetaFiles = map[string]*MetaFile{
icon := string([]rune(lines[0])[:2])
desiredWidth := lipgloss.Width(icon)
diff := desiredWidth - len([]rune(icon))
- icon += strings.Repeat(" ", diff)
+ if diff > 0 {
+ icon += strings.Repeat(" ", diff)
+ }
s.Icon = icon
}, Description: "icon can contain unicode symbols representing your source. It will be used in the TUI. It will be cropped to maximum two symbols and padded if shorter."},
}