This ensures that the viewport content is set and persisted correctly.
Setting the content during View won't doesn't work because it mutates a
copy of the model instead without persisting the changes. Moreover, any
after effects of setting the content won't be visible because the next
Update will be called on the older model, not the new one.
This commit exposes the MoveToBegin and MoveToEnd methods in the
textarea package, allowing users to programmatically move the cursor
to the beginning or end of the input text.
Since LeftGutterFunc is public, it can be nil if viewport is
instantiated without using `viewport.New()`. This commit adds nil
checks to handle this case.
* 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(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>
This breaks the API and removes high performance rendering and its
related methods from the viewport package. It changes the API and
makes the methods return nothing instead of lines to render.
* feat(key): accept any stringer interface to match keys
This allows any `fmt.Stringer` interface to match key bindings. We need
this in the upcoming v2 changes.
* Update key/key.go
Co-authored-by: Christian Rocha <christian@rocha.is>
* Update key/key.go
Co-authored-by: Christian Rocha <christian@rocha.is>
---------
Co-authored-by: Christian Rocha <christian@rocha.is>