Commit Graph

19 Commits

Author SHA1 Message Date
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
8c7abe7335
fix: lint issues
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-09-17 09:40:12 -03:00
Zimo Li
ed0b62f7e9
feat(pager): use home/end to go to top/bottom (#548) 2024-04-30 12:40:26 -04:00
Code_Zealot
4bdcb2bc0c
Update example in comment to latest pager syntax (#542) 2024-04-18 07:23:40 -04: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
Maas Lalani
0c1cc8e669
fix(pager): lint 2023-06-29 17:43:58 -04:00
Dieter Eickstaedt
abae6fd80c
feat: Adding timeout option to Pager command (#381) 2023-06-29 17:27:25 -04:00
Maas Lalani
b6f739d7d1
refactor: use exit.StatusAborted, unexport heightOffset 2023-06-29 16:36:47 -04:00
Dieter Eickstaedt
ae1da5d329
Feature/218/adding timeout option (#379)
* feat: Adding timeout option in preparation for coming timeout features in all commands

* feat: Adding timeout option in preparation for coming timeout features in all commands

* feat: Adding timeout option in preparation for coming timeout features in all commands

* chore: Linter issues
2023-06-29 16:35:03 -04:00
Carlos Alexandro Becker
a892c39289
fix: format pager/options.go
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-05-30 14:29:41 +00: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
Mikael Fangel
ec2b8d0fee
removed bksp from stdin (#306)
* removed bksp from stdin

---------

Co-authored-by: Maas Lalani <maas@lalani.dev>
2023-03-13 16:35:29 -04:00
Leon Stam
e108bc4668 feat(pager): add --soft-wrap option to gum pager 2022-12-13 14:34:58 -05:00
Maas Lalani
fd58eb07fc
fix: use program.Run() in pager 2022-10-17 20:26:26 -04:00
Maas Lalani
844727f185
fix(table): hide extra style flags + fix envprefix 2022-10-13 11:02:08 -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
430ab459d7 feat(pager): gum pager for scrolling through long documents 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