Commit Graph

64 Commits

Author SHA1 Message Date
Carlos Alexandro Becker
b9611e1d83
fix: lint issues (#663) 2024-09-06 12:06:27 -03:00
Carlos Alexandro Becker
f55c314558
fix(deps): update huh 2024-08-14 14:01:26 -03:00
Carlos Alexandro Becker
d722a2f1b8
fix: height 0 by default (#640) 2024-07-25 15:50:22 -04:00
Carlos Alexandro Becker
9db5c7fbba
fix: select all keybinding (#639)
* fix: select all keybinding

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* chore(deps): update gum

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-07-25 15:45:13 -04:00
Christian Rocha
ecb57b7e97 revert: "added timeout option to choose and other patches (maybe) (#618)"
This reverts commit 1d07efda84.
2024-07-24 15:26:27 -04:00
Christian Rocha
93beeb6538 Revert "Add key/value feature for gum choose (#530) (#598)"
This reverts commit 9a3e11f542.
2024-07-24 15:17:36 -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
Yachen Mao
9a3e11f542
Add key/value feature for gum choose (#530) (#598)
* Add key/value feature for `gum choose` (#530)

* trim the space of key and value

* using SplitN
2024-07-12 00:26:54 -04:00
Sandeep Chayapathi
1d07efda84
Added timeout option to choose and other patches (maybe) (#618)
* Added timeout option to choose

ref: https://github.com/charmbracelet/gum/issues/565

* Update 'charmbracelet/huh' dependency to main

* removed the `replace ..` huh line

* tidy'd the dependency tree!
2024-07-11 22:28:30 -04:00
Christian Rocha
fa2f67d1d6
fix: also drop left padding in choose (#597)
* fix: also drop left padding in choose

* chore(choose): wipe base theme

Co-authored-by: Maas Lalani <maas@lalani.dev>

---------

Co-authored-by: Maas Lalani <maas@lalani.dev>
2024-06-02 07:51:03 -04:00
Maas Lalani
baf36ae662
fix: remove border left on active element 2024-05-31 16:11:26 -04:00
Maas Lalani
a8712df2a7
Show help with Huh? (#587)
* chore(deps): bump deps

* feat: show help using huh?

* fix: lint

* fix: test.sh
2024-05-25 14:51:20 -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
44906e23b9
Use Huh for Gum Choose (#521)
* feat: use huh for gum choose (select + multiselect)

Uses Select for gum choose and MultiSelect for gum choose --no-limit.

* chore: bump to 1.21
2024-03-28 14:22:03 -04: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
Maas Lalani
a61f3bdc3f
fix(choose): --no-limit when 1 option available should still allow selection 2023-07-25 12:38:55 -04:00
Maas Lalani
6763de12e8
fix(choose): set initial page for selected 2023-07-25 12:34:00 -04:00
Maas Lalani
4b998515fd
feat(choose): use home/end to go to first/last option 2023-07-25 12:28:02 -04:00
Dieter Eickstaedt
d1ad453ce6
feat: Timeout for Choose Command (#384) 2023-06-30 09:28:46 -04:00
Maas Lalani
92c890e717
fix: use lipgloss.Width instead of runewidth.StringWidth 2023-05-11 22:21:09 -04:00
Maas Lalani
6dbadf30b4 fix: strip ansi when stdout is not a tty 2023-04-06 17:36:29 -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
Maas Lalani
99e6625a39
fix: don't use deprecated pager functions 2023-03-03 13:15:50 -05:00
Maas Lalani
e6de7749b1
fix: require choice for multiselect 2023-02-27 19:05:50 -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
Dhruv Manilawala
08ed3e2519
feat(choose): keep order of selected items (#182)
* feat(choose): keep order of selected items

* fix: KeepOrder -> Ordered

Co-authored-by: Maas Lalani <maas@lalani.dev>
2023-01-12 13:36:11 -05:00
Maas Lalani
c8e6b4a9d5
fix: trim only trailing newline, space may be intentional 2022-12-13 15:41:01 -05:00
Maas Lalani
2d54d5394e feat(choose): add ctrl+j / ctrl+k keybindings 2022-12-13 14:41:29 -05:00
Kevin Pham
57c8c90bfd feat(choose): use tab to toggle selection
Resolves #200
2022-10-18 16:31:21 -04:00
Maas Lalani
2e4ddce3f7
fix: use program.Start 2022-10-17 20:23:59 -04:00
Dhruv Manilawala
2c66222fd8 fix(choose): error if selected options > limit
Rationale: If the number of selected options in `--selected` flag is
greater than the limit, the last `n` options are selected where `n` is
the limit.
2022-10-13 11:01:21 -04:00
Maas Lalani
db75c218de
fix(choose): selected bug when limit == 1 2022-10-07 18:57:26 -04:00
Matt Farstad
fa533691c4
feat(choose): Preselect the Selected Option When Limit is One (#166)
* Add startingIndex variable to choose model

* refactor: simplify code branches

Co-authored-by: Matthew Farstad <matthewwilliamfarstad@gmail.com>
Co-authored-by: Maas Lalani <maas@lalani.dev>
2022-10-02 12:51:35 -04:00
Maas Lalani
c71c918c86
fix(choose): fix spacing for limit == 1 gum choose 2022-09-07 21:01:42 -04:00
Maas Lalani
21332c833a
feat(choose): Change default icons to match gum filter 2022-09-07 15:43:15 -04:00
Vaniel
76fc2f3d91 feat(choose): improving selected option parse 2022-09-06 16:13:53 -04:00
Vaniel
6abc94c87a feat(choose): add --selected option to choose command 2022-09-06 16:13:53 -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
81602545a6
refactor: don't trim newline if we are going to Println anyway
Just use `Print` with the newline
2022-09-02 14:37:26 -04:00
fedeztk
6b7f5ef77b
fix(choose): wrong "a" behavior (#137) 2022-08-30 12:24:25 -04:00
Maas Lalani
08346909a9
feat(choose): Wrap around choose list and g/G keybindings (#122)
* `G` goes to last element / `g` goes to first element
* Wrap around on first and last elements
2022-08-18 17:12:00 -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
bba0f3b1e0
refactor: remove unneeded set:"name=" 2022-08-03 12:28:02 -04:00
Maas Lalani
197e52a362
feat: escape as abort option (like ctrl+c) 2022-08-02 21:00:42 -04:00
Dolev Hadar
fb4a9e6320 fix: skip if limit is <= 1 2022-08-02 13:57:55 -04:00