Skip to content

Conversation

@AustinJ235
Copy link
Owner

This pull request introduces TextBodyGuard which is used for text body modification.

This is required for the TextEntry, TextEditor and CodeEditor widgets coming soon...

- impl `is_valid_cursor`, `cursor_prev` & `cursor_next`
- Refactor line start/end cursors to handle char byte offsets and wrapped lines correctly.
- Refactor cursor display to be more accurate and handle new lines better.
- Turn `TextCursor` into an enum.
- Allow Cursor to be displayed even when the body is empty.
- Remove text test example as that is no longer needed. (See basalt-widgets repo)
- Fixed issue where scrolling was not being applied to content. (text & user vertexes)
- Make cursor_bounds return [MIN_X, MAX_X, MIN_Y, MAX_Y] instead of [MIN_Y, MAX_Y, MIN_X, MAX_X] to be consistent with other api's.
- Fix get_text_cursor_bounds calculating tlwh incorrectly.
Calling various getter methods of `Bin` while using methods that take a closure could result in deadlocks.
- Add docs for `get_text_cursor` & `get_text_cursor_bounds`.
- Fix potential deadlock in `get_text_cursor_bounds`.
- Fix `get_text_cursor_bounds` from using the `TextBody`'s cursor instead of the one provided.
This fixes an issue where if the cursor is moved up or down at the end of the line when text was wrapped it would be moved incorrectly.
- replace `selection_value` with `selection_string`
- refactor `selection_delete`
- impl `selection_spans`
- impl `selection_take_spans`
- impl `selection_take_string`
- mockup `cursor_insert_string` & `cursor_insert_spans`
@AustinJ235 AustinJ235 merged commit 1c87970 into master Oct 24, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants