Skip to content

Caught panic - strings: negative Repeat count #14

@cameronj86

Description

@cameronj86

Below is the error message. It loads successfully but crashes when I try to filter. The config file is shared as well, mostly of some personal cheatsheets that I ran through Claude

$ gocheat
Caught panic:

strings: negative Repeat count

Restoring terminal...

goroutine 1 [running]:
runtime/debug.Stack()
        /usr/lib/go-1.24/src/runtime/debug/stack.go:26 +0x5e
runtime/debug.PrintStack()
        /usr/lib/go-1.24/src/runtime/debug/stack.go:18 +0x13
github.com/charmbracelet/bubbletea.(*Program).Run.func1()
        /home/user/.local/bin/go/pkg/mod/github.com/charmbracelet/bubbletea@v0.27.0/tea.go:511 +0x8b
panic({0x589420?, 0x60dd00?})
        /usr/lib/go-1.24/src/runtime/panic.go:792 +0x132
strings.Repeat({0x60ce70?, 0x1?}, 0x1?)
        /usr/lib/go-1.24/src/strings/strings.go:624 +0x585
github.com/Achno/gocheat/internal/components.listItemImpl(0x41, {0xc00001b3e0, 0x59}, {0xc0003d5860, 0x22}, {0x784e80?, 0xc000124c30?, {0x0?, 0xc0001bc400?}}, {0x784e80, ...})
        /home/user/.local/bin/go/pkg/mod/github.com/!achno/gocheat@v0.1.1/internal/components/list.go:18 +0xb7
github.com/Achno/gocheat/internal/components.ListItemInactive(0x41, {0xc000024050?, 0xc0001153e0?}, {0xc0000128b0, 0xb})
        /home/user/.local/bin/go/pkg/mod/github.com/!achno/gocheat@v0.1.1/internal/components/list.go:36 +0x13d
github.com/Achno/gocheat/internal/ui.ItemDelegate.Render({}, {_, _}, {0x1, 0x1, 0x0, 0x0, 0x0, 0x1, {0x5bfc7f, ...}, ...}, ...)
        /home/user/.local/bin/go/pkg/mod/github.com/!achno/gocheat@v0.1.1/internal/ui/list.go:77 +0xcf
github.com/charmbracelet/bubbles/list.Model.populatedView({0x1, 0x1, 0x0, 0x0, 0x0, 0x1, {0x5bfc7f, 0x4}, {0x5bfd91, 0x5}, ...})
        /home/user/.local/bin/go/pkg/mod/github.com/charmbracelet/bubbles@v0.18.0/list/list.go:1185 +0x283
github.com/charmbracelet/bubbles/list.Model.View({0x1, 0x1, 0x0, 0x0, 0x0, 0x1, {0x5bfc7f, 0x4}, {0x5bfd91, 0x5}, ...})
        /home/user/.local/bin/go/pkg/mod/github.com/charmbracelet/bubbles@v0.18.0/list/list.go:1036 +0x49b
github.com/Achno/gocheat/internal/ui.ItemScreen.View({{0x1, 0x1, 0x0, 0x0, 0x0, 0x1, {0x5bfc7f, 0x4}, {0x5bfd91, 0x5}, ...}})
        /home/user/.local/bin/go/pkg/mod/github.com/!achno/gocheat@v0.1.1/internal/ui/list.go:201 +0xc5
github.com/charmbracelet/bubbletea.(*Program).eventLoop(0xc0000b4480, {0x60ee10?, 0xc000144008?}, 0xc0000901c0)
        /home/user/.local/bin/go/pkg/mod/github.com/charmbracelet/bubbletea@v0.27.0/tea.go:446 +0x75f
github.com/charmbracelet/bubbletea.(*Program).Run(0xc0000b4480)
        /home/user/.local/bin/go/pkg/mod/github.com/charmbracelet/bubbletea@v0.27.0/tea.go:582 +0xa0b
main.main()
        /home/user/.local/bin/go/pkg/mod/github.com/!achno/gocheat@v0.1.1/main.go:28 +0x2ff
Config file

{ "items": [ { "title": "Navigate down : j", "tag": "discordo-global" }, { "title": "Navigate up : k", "tag": "discordo-global" }, { "title": "Reset selection : Esc", "tag": "discordo-global" }, { "title": "Quit : Ctrl+C", "tag": "discordo-global" }, { "title": "Delete credentials : Ctrl+D", "tag": "discordo-global" }, { "title": "New line : Alt+Enter", "tag": "discordo-input" }, { "title": "Delete word : Ctrl+W / Alt+Backspace", "tag": "discordo-input" }, { "title": "Previous line : Up", "tag": "discordo-input" }, { "title": "Next line : Down", "tag": "discordo-input" }, { "title": "Delete to start : Ctrl+U", "tag": "discordo-input" }, { "title": "Send message : Enter", "tag": "discordo-input" }, { "title": "Open in editor : Ctrl+E", "tag": "discordo-input" }, { "title": "Reply : r", "tag": "discordo-message" }, { "title": "Reply with mention : R", "tag": "discordo-message" }, { "title": "Delete : d", "tag": "discordo-message" }, { "title": "Yank content : y", "tag": "discordo-message" }, { "title": "Channel select : Ctrl+G", "tag": "discordo-guilds" }, { "title": "Expand : Ctrl+M", "tag": "discordo-guilds" }, { "title": "Quick-select : Ctrl+R", "tag": "discordo-guilds" }, { "title": "Hide sidebar : Ctrl+B", "tag": "discordo-guilds" }, { "title": "Switch channel : Ctrl+T", "tag": "discordo-guilds" }, { "title": "To input : Ctrl+P", "tag": "discordo-guilds" }, { "title": "First item : g", "tag": "discordo-guilds" }, { "title": "Last item : G", "tag": "discordo-guilds" }, { "title": "Install tool : uv tool install PKG", "tag": "uv-tools" }, { "title": "Run tool : uvx PKG", "tag": "uv-tools" }, { "title": "List tools : uv tool list", "tag": "uv-tools" }, { "title": "Update tool : uv tool upgrade PKG", "tag": "uv-tools" }, { "title": "Update all : uv tool upgrade --all", "tag": "uv-tools" }, { "title": "Remove tool : uv tool uninstall PKG", "tag": "uv-tools" }, { "title": "Show info : uv tool show PKG", "tag": "uv-tools" }, { "title": "Create venv : uv venv", "tag": "uv-projects" }, { "title": "Install reqs : uv pip install -r requirements.txt", "tag": "uv-projects" }, { "title": "Sync project : uv sync", "tag": "uv-projects" }, { "title": "Run script : uv run python script.py", "tag": "uv-projects" }, { "title": "Run command : uv run CMD", "tag": "uv-projects" }, { "title": "Upgrade reqs : uv pip install --upgrade -r requirements.txt", "tag": "uv-projects" }, { "title": "Upgrade sync : uv sync --upgrade", "tag": "uv-projects" }, { "title": "Install Python : uv python install 3.12", "tag": "uv-python" }, { "title": "List Pythons : uv python list", "tag": "uv-python" }, { "title": "Run w/ deps : uv run --with PKG script.py", "tag": "uv-python" } ], "styles": { "subtext": "#6c7086", "accent": "#b4befe" } }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions