Carlos Alexandro Becker
86e8fc0a5b
fix: if sort, sort options alphabetically first
2024-12-03 15:13:50 -03:00
Carlos Alexandro Becker
bc64a68142
fix: clarify filter --sort flag
...
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-12-03 13:26:48 -03:00
Carlos Alexandro Becker
098d09a270
fix(choose,confirm,file,filter,input,pager,spin): timeout default unit ( #724 )
...
Change it `0s` instead of `0`.
closes #402
2024-11-18 17:10:06 -03:00
Carlos Alexandro Becker
3cec9b7b9a
fix(filter): panic if no matches
...
closes #715
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-11-18 10:00:10 -03:00
Carlos Alexandro Becker
b9611e1d83
fix: lint issues ( #663 )
2024-09-06 12:06:27 -03:00
Carlos Alexandro Becker
046a4d361e
fix: use 0 as default width ( #634 )
...
* fix: use 0 as default width
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
* fix: filter width
---------
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-07-25 13:12:30 -04:00
Piero Lescano
8422c49018
feat(filter): Add cyclic navigation ( #483 )
2024-07-25 10:02:56 -04:00
Mikael Fangel
b0f4413188
chore: remove explicitly defined max functions ( #613 )
...
* filter: remove max function
* timeout: remove max function
2024-07-25 09:57:35 -04:00
Ayman Bagabas
c5aa209eed
refactor(ansi): drop ansi in favor for x/ansi
2024-07-16 15:17:46 -04:00
Ayman Bagabas
405f246635
refactor: use x/term instead of go-isatty
2024-07-16 15:17:46 -04:00
Mikael Fangel
2fe0291e02
fix(stdin): add trim of trailing newline ( #577 )
...
* stdin: add trim of trailing newline
* choose: remove trimsuffix
* filter: remove trimsuffix
* style: remove trimsuffix
2024-05-25 14:44:01 -04:00
Maas Lalani
2d896f777e
feat(filter): allow customizing placeholder
2024-01-13 15:33:58 -05:00
snan
a11d1ff648
fix: Make --select-if-one print to stdout ( #463 )
...
For some reason it wasn't printing to stdout (and I could repro that
bug even on versions before I added the newline). It was only showing
up on other streams in the shell (error stream probably), not getting
sent into pipes.
I changed it to fmt.Println.
As for the ansi-stripping that was in `filter`, LMK if that's what you
prefer and I'll add it to `choose` too. I just wanted them to match.
2023-12-10 13:52:11 -05:00
snan
d1145b4163
Add newline printing to --select-if-one ( #459 )
...
* Add newline printing to --select-if-one
This matches how choose works normally when there are more than
one option.
* Add newline printing to filter --select-if-one
To match how it works without --select-if-one.
2023-12-07 10:29:40 -05:00
Maas Lalani
01a66511a1
Hide Style Flags consistently ( #457 )
...
* refactor: hide style flags on error to not clutter usage
* docs(style): add comment regarding dynamically hiding flags
2023-11-28 14:17:57 -05:00
Kenny Parnell
fb6849ca16
Add --select-if-one flag to choose/filter. ( #398 )
...
* Add `--select-if-one` flag to `choose`/`filter`.
* Remove accidental commit of other changes.
* fix: use o.Options
---------
Co-authored-by: Maas Lalani <maas@lalani.dev>
2023-11-28 12:34:50 -05:00
Mikael Fangel
971b6cf16f
fix(filter): made filter work with lists as choose ( #424 )
...
* made filter work with lists as choose
* lint fix
* response to code review
2023-10-03 16:33:57 -04:00
Dieter Eickstaedt
7e71c4d664
feat: Adding timeout option to Filter command ( #380 )
2023-06-29 17:29:46 -04:00
ROMAIN GUISSET
99f1348a45
feat(filter): add cursor text line styling
2023-06-27 10:37:13 -04:00
Carlos Alexandro Becker
5a4b12c8ca
feat: gum filter --no-sort
...
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-05-30 09:42:41 -05:00
Maas Lalani
92c890e717
fix: use lipgloss.Width instead of runewidth.StringWidth
2023-05-11 22:21:09 -04:00
Maas Lalani
5887a10fa0
fix: strip ansi from gum filter when output is not a tty
2023-04-06 17:36:29 -04:00
Maas Lalani
bb103c0a03
fix: show header only if not empty
2023-03-22 11:17:06 -04:00
Mikael Fangel
97feb1b4d0
feat: adds headers for choose and filter ( #307 )
...
* added header to choose
* corrected mistake in envvar
* added header for filter
* simplified return logic for filter
* Update choose/options.go
* render the header before calculating the height
---------
Co-authored-by: Maas Lalani <maas@lalani.dev>
2023-03-14 15:58:48 -04:00
mikael
708a653eae
Fix for using --value in combination w/ --no-fuzzy
...
This add a check if the no fuzzy flag is set together with the
--no-fuzzy flag.
2023-03-09 12:42:55 -05:00
MuXiu1997
877c475aa6
feat: add ctrl+@(ctrl+space) keybinding for choose and filter ( #276 )
...
* feat(filter): add ctrl+@ keybinding
* feat(choose): add ctrl+@ keybinding
2023-02-27 18:59:40 -05:00
Maas Lalani
c8e6b4a9d5
fix: trim only trailing newline, space may be intentional
2022-12-13 15:41:01 -05:00
Dieter Eickstaedt
b0aba2261d
feature(choose): Adding option to use non-matching filter as result ( #233 )
2022-11-09 13:54:47 -05:00
Maas Lalani
2e4ddce3f7
fix: use program.Start
2022-10-17 20:23:59 -04:00
Maas Lalani
08c34cfa2f
chore: use --[no-]fuzzy as flag
2022-10-13 10:58:57 -04:00
Enrico Candino
8dec822e75
avoid Fuzzy search
2022-10-13 10:58:57 -04:00
Enrico Candino
d45b728b4d
fix "shuffling"
2022-10-13 10:58:57 -04:00
Enrico Candino
d74f126d41
added exact match to filter
2022-10-13 10:58:57 -04:00
Christian Muehlhaeuser
86fa35d672
perf: speed up filter rendering
...
We don't need to style each character individually, buffer them
and flush before highlights.
2022-10-07 23:01:38 -04:00
Dhruv Manilawala
a82d5af1e8
feat(filter): add reverse layout ( #177 )
...
* feat: add reverse layout for filter command
* fix: linter warnings
* fix: keep viewport yoffset constant in reverse layout
2022-10-07 15:23:28 -04:00
Dhruv Manilawala
5c98432070
feat: use shift+tab to toggle selection and move up ( #167 )
...
* feat: use `shift+tab` to toggle selection and move up
* refactor: extract CursorUp, CursorDown, ToggleSelection methods
Co-authored-by: Maas Lalani <maas@lalani.dev>
2022-10-02 12:47:41 -04:00
Maas Lalani
aa7683f5e0
fix: full width on gum filter
2022-09-08 12:36:37 -04:00
Maas Lalani
808f879996
lint: fix lint error unparam on clamp
2022-09-02 21:39:01 -04:00
fedeztk
c9fe558a44
feat(filter): Multi-select ( #130 )
...
* feat(filter): added multiple selections
* docs(filter): corrected comments about multiSelection print
* feat(filter): fix proposed changes on naming variables and map type
* feat(filter): actually fix map types
* feat(filter): use `○` / `◉` as unselected / selected multi-select options
Co-authored-by: Maas Lalani <maas@lalani.dev>
2022-09-02 21:21:31 -04:00
Maas Lalani
9b3c8c0db0
Allow --value to pre-populate gum filter ( #113 )
...
* Add --value option to filter command
Modeled after fzf's --query option this allows the inital model to be
prefiltered.
Additionally, if the initial list, before being filtered by --value, is
empty then treat this as an error. Filtering an empty list doesn't make
sense.
Co-authored-by: David Morgan <david_a_morgan@icloud.com>
2022-08-08 16:54:24 -04:00
Maas Lalani
84f3096665
perf: improve filter fuzzy by pre-allocating slice
2022-08-05 12:25:15 -04:00
Maas Lalani
1479184f3f
fix: satisfy all linters
2022-08-05 02:33:40 -04:00
Maas Lalani
46ce0e4761
feat: allow configuration via environment variables
2022-08-04 11:22:42 -04:00
Maas Lalani
35e044d140
fix: use WithAltScreen instead of deprecated EnterAltScreen
2022-08-04 11:21:51 -04:00
Maas Lalani
b8669c420b
fix: enter AltScreen if auto height
2022-08-04 11:15:21 -04:00
Maas Lalani
bba0f3b1e0
refactor: remove unneeded set:"name="
2022-08-03 12:28:02 -04:00
Maas Lalani
c049d1a5fa
feat: filter height and scrolling viewport
2022-08-02 16:40:57 -04:00
Maas Lalani
b670c6d674
refactor: bubble up ErrAborted
2022-07-30 21:42:48 -04:00
Maas Lalani
d324abeab5
refactor: exit package
2022-07-30 21:23:25 -04:00
Christian Muehlhaeuser
6538d726d1
feat: ctrl-c & esc abort filtering
2022-07-30 21:23:25 -04:00