* feat(textarea): add CursorPosition method
This returns the current cursor position accounting any soft-wrapped
lines and multi-rune characters.
* chore(textarea): redefine how real cursor properties are accessed (#714)
---------
Co-authored-by: Christian Rocha <christian@rocha.is>
* chore: revert "wip"
This reverts commit d020289a27, reversing
changes made to c288adf7ab.
* chore: revert "feat(textarea): add SetOffset and CursorPosition methods"
This reverts commit afbb7bc049.
* chor: revert "fix(textarea): respect double-width characters in real cursor position"
This reverts commit 804c370801.
* chore: revert "feat(textarea): use a real cursor position"
This reverts commit 8c3085a6cd.
If the viewport has borders, they are not currently taken into account
when calculating the viewport max y offset, which might cause the last
line to not be visible.
This is easily reproducible in `gum pager`.
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
* horizontal scroll
* rebase branch
* add tests
* add tests with 2 cells symbols
* trimLeft, move to charmbracelete/x/ansi lib
* up ansi package
* Update viewport/viewport.go
Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
* fix: do not navigate out to the right
* fix: cache line width on setcontent
* fix tests
* fix viewport tests
* add test for preventing right overscroll
* chore(viewport): increase horizontal step to 6
* chore(viewport): make horizontal scroll API better match vertical scroll API
* fix: nolint
* fix: use ansi.Cut
* perf: do not cut anything if not needed
* feat: expose HorizontalScrollPercent
* fix: do not scroll if width is 0
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
* fix: visible lines take frame into account
---------
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Co-authored-by: Christian Rocha <christian@rocha.is>
* chore(progress)!: migrate progress to lipgloss
This removes the dependency on termenv and replaces it with lipgloss. This
change also removes the WithColorProfile option, as it is no longer needed.
The new API uses `color.Color` types for colors, which are more flexible and
allow for more advanced color manipulation.
* Update progress/progress_test.go
Co-authored-by: Christian Rocha <christian@rocha.is>
* Update progress/progress_test.go
Co-authored-by: Christian Rocha <christian@rocha.is>
* chore: go mod tidy
---------
Co-authored-by: Christian Rocha <christian@rocha.is>
* textinput: fix slicing outside cap
* textinput: add test that makes slicing outside cap occur
* chore: tidy with gofmt
---------
Co-authored-by: bashbunni <bunni@bashbunni.dev>