* fix(textinput): out of range panic if no matched suggestions
* fix(textinput): out of bounds check
Co-authored-by: Maas Lalani <maas@lalani.dev>
---------
Co-authored-by: Maas Lalani <maas@lalani.dev>
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>
This reverts the code back to the logic from 4ce16e8 which fixed the
issue of the cursor not being moved when an initial value was set with
SetValue.
The fix regressed in 16053f4.
fixes infinite loop when deleting input that only contains whitespace
using deleteWordLeft()
fixes index out of range panic when deleting input that only contains
whitespace using deleteWordRight()
When EchoMode is not set to EchoNormal, alt+left/alt+b and
alt+right/alt+b jumps to the beginning and the end, respectively, so as
not to reveal word breaks in the masked text.
Previously, textinput.SetCursor, textinput.CursotStart, and
textinput.CursorEnd returned bools used interally for managing cursor
blinking. Those methods have been replaced with private counterparts.