Cosmetic change.
Old links used `master` as the main branch. Resulting in GitHub
redirecting to the correct default branch and displaying:
> Branch not found, redirected to default branch.
Signed-off-by: Michał Kotowski <dev@mkotowski.dev>
* feat(list): implement GlobalIndex helper
This commit introduces a new `filteredItem` field called `index` which
stores the index of the filtered item in the unfiltered list. This
allows to get at runtime the unfiltered list index for the selected (and
possibly filtered) item.
This is the only solution I found to use `SetItem` with a filtered
list.
The name `GlobalIndex` might not be ideal, I'm happy to change it to
something else. (`UnfilteredIndex`?)
Fixes: #550
* docs(list): improve Index() documentation
* Add SetFilterText and SetFilterState
* make linter happy
* make SetFilterState state not hardcoded
* tests for SetFilterText and SetFilterState
* fix small typo
---------
Co-authored-by: k-x7 <97758178+k-x7@users.noreply.github.com>
As the number of items in `targets` is known, use `make` with the
expected size instead of appending, which requires more allocations as
the `targets` slice grows.
* feat: allow to set the height of the item
The user might want to show more than 2 lines, and, right now, if they
try to do so, things break.
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
* fix: short-circuit if width <= 0
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
* fix: height check
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
Bug: when calling SetItems when items was previously empty, the keybindings for
up/down do not appear.
Fix: call updateKeybindings in SetItems.
Signed-off-by: Christian Stewart <christian@paral.in>