Skip to main content

text_apply_edits

Function text_apply_edits 

Source
pub fn text_apply_edits(
    requests: MessageReader<'_, '_, TextEditRequest>,
    applied: MessageWriter<'_, TextEditApplied>,
    rejected: MessageWriter<'_, TextEditRejected>,
    q: Query<'_, '_, (&mut TextBuffer, &mut TextCursor, &mut UndoStack, Option<&mut ImePreedit>)>,
    commands: Commands<'_, '_>,
)
Expand description

The single text mutator (W3.2). Drains lumen_core::text_events::TextEditRequest and mutates TextBuffer / TextCursor / UndoStack / ImePreedit in place. Emits TextEditApplied after each accepted edit and TextEditRejected for validator / single-line newline / undo-empty rejections.

Execution-order contract:

  • Runs AFTER every producer (route_ime_events, type_into_focused, pointer drag, script set_text, paste).
  • Runs BEFORE text_mirror_buffer_to_content so the mirror sees the post-mutation rope.
  • Runs BEFORE bind-text push systems so they see only post-mutation text.