Replace everything with text and put the caret at the start. History is cleared.
- edit: the text being edited.
- text: the new text.
edit: Text_Edit;
defer free_text_edit(*edit);
set_contents(*edit, "one\ntwo");
assert(contents(*edit) == "one\ntwo");set_contents :: (edit: *Text_Edit, text: string)
Replace everything with text and put the caret at the start. History is cleared.
Parameters
- edit: *Text_Edit
- the text being edited.
- text: string
- the new text.
edit: Text_Edit;
defer free_text_edit(*edit);
set_contents(*edit, "one\ntwo");
assert(contents(*edit) == "one\ntwo");