The selected text, valid until the next edit.
- edit: the text being edited.
edit: Text_Edit;
defer free_text_edit(*edit);
set_contents(*edit, "hello world");
move_caret(*edit, 6);
move_caret(*edit, 11, extend = true);
assert(selected_text(*edit) == "world");selected_text :: (edit: *Text_Edit) -> string
The selected text, valid until the next edit.
Parameters
- edit: *Text_Edit
- the text being edited.
Returns
- string
edit: Text_Edit;
defer free_text_edit(*edit);
set_contents(*edit, "hello world");
move_caret(*edit, 6);
move_caret(*edit, 11, extend = true);
assert(selected_text(*edit) == "world");