Commit graph

22 commits

Author SHA1 Message Date
Carlos Alexandro Becker
b0c9c58302
fix(stdin): trim space instead of \n (#761)
we were trimming an ending \n, but it would then break a \r\n sequence, causing misrenders.

this fixes it

closes #682

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-12-10 21:27:13 -03:00
Carlos Alexandro Becker
2939e516cc
fix(pager): do not strip ansi sequences (#754) 2024-12-09 17:54:17 -03:00
Carlos Alexandro Becker
fb543c3294
fix: strip ansi sequences from stdin (#739)
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-12-09 14:44:43 -03:00
Carlos Alexandro Becker
4f469522d5
feat: handle interrupts and timeouts (#747) 2024-12-09 14:30:35 -03:00
Carlos Alexandro Becker
e30fc5ecdf
refactor: removing huh as a dep (#742)
* Revert "feat: huh gum write (#525)"

This reverts commit 4d5d53169e.

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

* Revert "Use Huh for Gum Confirm (#522)"

This reverts commit f7572e387e.

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

* revert: Use Huh for Gum Choose (#521)

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

* revert: feat: huh for gum input (#524)

* revert: feat: huh file picker (#523)

* feat: remove huh

* fix: timeouts

* fix: lint issues

* fix(choose): quit on ctrl+q

ported over 63a3e8c8ce

* fix: ctrl+a to reverse selection

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

* fix: better handle spin exit codes

* fix(file): bind --[no-]permissions and --[no-]size

* feat(confirm): show help

* fix(confirm): fix help style

* fix(file): help

* fix(input): --no-show-help doesn't work

* fix(input): help

* fix(file): keymap improvement

* fix(write): focus

* feat(write): ctrl+e, keymaps, help

* feat(choose): help

* feat(filter): help

* refactor: keymaps

* fix(choose): only show 'toggle all' if there's no limit

* fix(choose): don't show toggle if the choices are limited to 1

* fix(filter): match choose header color

* fix(filter): add space above help

* fix(filter): factor help into the height setting

* chore(choose,filter): use verb for navigation label in help

* fix(filter): hide toggle help if limit is 1

* fix(file): factor help into height setting (#746)

* fix: lint issues

* fix(file): handle ctrl+c

* fix: remove full help

* fix: lint

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Co-authored-by: Christian Rocha <christian@rocha.is>
2024-12-09 13:18:35 -03:00
Carlos Alexandro Becker
c868aa1c6c
fix(confirm,choose,file,input): timeout handling (#718)
* fix(confirm,choose,file,input): timeout handling

- some fields were not actually using the `--timeout` value
- some fields had different behavior when a timeout did occur. On this
  matter, it seems to me the best way forward is to specifically say it
  timed out, and after how long
- added exit status 124 (copied from `timeout` from coreutils) (fixes #684)

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

* Update main.go

Co-authored-by: Ayman Bagabas <ayman.bagabas@gmail.com>

* Update internal/exit/exit.go

Co-authored-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com>

* fix: improve

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

* fix: stderr

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Co-authored-by: Ayman Bagabas <ayman.bagabas@gmail.com>
Co-authored-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com>
2024-11-18 10:49:15 -03: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
Christian Rocha
6e802805cf fix(docs): correct LipglossPadding doc comment 2023-05-18 12:26:33 -04:00
Christian Rocha
b23ebce896 fix: measure runes instead of bytes when truncating
There are a couple of gotchas in LipGlossTruncate:

* len() returns the number of bytes in a string
* slicing a string slices it on a byte level

The fix would normally be to convert the string to a slice of runes and
operate on that new slice:

r := []rune(str)

However, reflow already contains an ansi-aware truncate feature that we
can use instead as a drop-in replacement for the LipGlossTruncate
function.
2023-05-18 11:45:14 -04:00
Mikael Fangel
c8710071ad
feature(pager): add search functionality (#321)
* Added initial search functionality

 * Added a handler for the key presses
 * Added a searchbar at the bottom of the screen
 * Made search results cycleable by pressing n

* correct start pos and ignore keys while searching

* fix out of bound error when pressing n

* made the matching pattern relative to the current pos

* added p for searching for previous match

* added highlighting to search matches

* dynamically replaced all matches

* fixed string highlight issue

* fixed truncation issue

* small simplifaction in ypos logic

* made prev and next behave the same atBottom

* simplified logic and fixed linter errors

* updated help text

* style changes

* added comments

* fixed truncation issue

* fixes infinte loop on very long lines

* added simple lipgloss truncate function

* updated colors for better contrast

* lint fix

* initial commit for soft-wrap functionality

* linter corrections and added for pager with new model

* added generic functions to a utility package

* fix soft lint errors

* made N match previous as well as p

* replaced help text when search is active

* ran gofmt -w

* reimplemented search and next to enabled support for dynamic highlights

* made the highlight move as you progress through the search

* simplified highlighter

* improvements to the clean up of the highlight function

* semi working reverse search

* reverse search without highlight

* added semi working highlight for reverser search

* working version of previous match

* fixed issue with single letter matches in next

* added support for softwrapping

* respond to soft lint warnings

* removed unused function

* lint

* simplified matchers and fixed duplicate highlights

* optimisations and change in matching pattern

* fixed bug in lipglosspadding and allowed matching 1 etc.

* make highlight respect user settings

* fixed logic error in slice

* made prev match wrap around

* fix: show next/prev match help when active

* updated how view port line is set

* avoid crashes when regex doesn't compile

* fix: spelling previous

---------

Co-authored-by: Maas Lalani <maas@lalani.dev>
2023-05-14 23:19:07 -04:00
Maas Lalani
995bd04e38 docs: document gum table, file, pager
This commit documents `gum table`, `gum file`, and `gum pager` with
demonstration GIFs and sample scripts.
2022-10-07 15:38:48 -04:00
Maas Lalani
2bea4dc030 feat(file): gum file to pick files 2022-10-07 15:38:48 -04:00
Maas Lalani
bdd86d5fbc feat(table): gum table for tabular data 2022-10-07 15:38:48 -04:00
Maas Lalani
1479184f3f fix: satisfy all linters 2022-08-05 02:33:40 -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
Maas Lalani
cb590e324e chore: fix linting 2022-07-30 18:04:26 -04:00
Christian Muehlhaeuser
66993d8ef1
Add soft & hard linter configs & workflows (#44)
* chore: add linter configs & workflows

* fix: ignore certain linter warnings

* fix: mark errors as intentionally ignored

* fix: avoid unnecessary conversion

* fix: handle template/renderer errors

* fix: mark intentionally unused code
2022-07-30 12:32:59 -04:00
Maas Lalani
d8ac24bcc6
fix: ignore node_modules by default 2022-07-07 22:39:28 -04:00
Maas Lalani
66e01ac849
feat: list all files if gum search receives no input. 2022-07-07 22:10:31 -04:00
Maas Lalani
53aa5c6a90
feat: Add gum join command 2022-07-07 19:32:21 -04:00
Maas Lalani
2320f10278
feat: add stdin input handling and logging helpers 2022-07-07 13:29:10 -04:00