Skip to content

choose crashes when in filter mode and you press spacebar twice #580

@MikaelFangel

Description

@MikaelFangel

Describe the bug
When you use choose, press / to filter and then presses spacebar twice it crashed with an index out of bounds error.

To Reproduce
Steps to reproduce the behavior:

  1. Run the command gum choose --no-limit x y z
  2. Press / to enter filter
  3. Press spacebar twice
  4. See error

Expected behavior
Filter shouldn't crashes from multiple spaces when in filter.

Additional context
Error message produced:

Caught panic:

runtime error: index out of range [0] with length 0

Restoring terminal...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions