As the number of items in `suggestions` and `m.suggestions` is known,
we can use `make` with the expected size instead of appending, which
requires more allocations as the slice grows.
* Fix pasting calculations
Available length calculation now correctly trims pasted text.
* fix(textInput): Width padding added when placeholder is used
When `placeholder` is set, padding from `Width` was not added within the `placeholderView()` function.
* Adding missing 'm.'
* Maintain Width no matter placeholder size delta
* Fixed Math
* Added Comments
* fix: lint
---------
Co-authored-by: Donovan Hubbard <37090676+donovanhubbard@users.noreply.github.com>
Co-authored-by: Maas Lalani <maas@lalani.dev>
* migrate all autocomplete-work from old branch
* added support for multiple suggestions
* fix linter issues
* refactored to only offer matching suggestions for completion
* fix: SetSuggestions + Suggestions
* make: configuration behaviour configurable
* fix for double-width runes
* refactored all suggestions to be rune-arrays
also: accepting suggestions does not overwrite the already given input, rather appends
* fix: make suggestions and OnAcceptSuggestions unexported
* refactor: refreshingMatchingSuggestions -> updateSuggestions
---------
Co-authored-by: Maas Lalani <maas@lalani.dev>
As the number of items in `targets` is known, use `make` with the
expected size instead of appending, which requires more allocations as
the `targets` slice grows.
This would be useful to know to stop displaying it after the user was shown
the progress bar to render to its end.
Solution: expose `IsComplete` method is based on what's been drawn
* feat(filepicker): ignore messages from other filepicker instances
* feat(filepicker): initialize default styles against a lipgloss renderer
* chore(filepicker): swap global var for function with default keymap
* fix(progress): add failing test
The progress bar component does not render the gradient 100% correctly:
The very last color that appears in the rendered progress bar should be
the second color defined in the gradient but it is not, due to an
off-by-one one error.
This test case shows this. The next commit will contain the fix.
* fix(progress): use the second gradient color as the last char of the bar
Due to an off-by-one error, the very last rendered color+char was never
exactly the second specified gradient color. The fixed code looks less
elegant unfortunately, but now the last color is the desired one.
Previously, when inserting multiple lines of input at once, the underlying
Go data array was incorrectly shared in memory across multiple rows
of the textarea. This was causing input corruption, where a user trying
to modify one line would see their text added on the next line as well.
This patch fixes it.
* fix(textarea): app would crash if deleteWordRight was called at the end
of line
* fix(textarea): deleteWordRight would work incorrectly
Co-authored-by: infastin <thecookied123@gmail.com>