Skip to main content

Module edit

Module edit 

Source
Expand description

Pure functions for editing a Vec<InlineContent> based on selections.

Entry points: edit_text (single edit, multiple cursors), edit_text_multi (per-cursor text), and inspect_delete (preview what a delete would remove).

Enums§

TextEdit
An enum representing a single text editing action.

Functions§

apply_edit_to_selection
Applies a single edit to a single selection.
delete_backward
Deletes one grapheme cluster backward from the cursor.
delete_forward
Deletes one grapheme cluster forward from the cursor.
delete_range
Deletes the content within a given range.
edit_text
The primary entry point for text modification. Takes the current content and selections, applies an edit, and returns the new content and the resulting cursor positions.
edit_text_multi
Edit text with different text per selection (for N-lines-to-N-cursors paste).
insert_text
Inserts text at a cursor position.
inspect_delete
Returns the range and text that a delete operation would remove, without actually modifying the content.