UI module

insert_newline

procedureextensionexperimentalsince 0.31.0Source

Insert a line break, repeating the current line's leading blanks.

Example↗
edit: Text_Edit;
defer free_text_edit(*edit);
set_contents(*edit, "    indented");
move_caret(*edit, 12);
insert_newline(*edit);
assert(contents(*edit) == "    indented\n    ");
insert_newline :: (edit: *Text_Edit)

Insert a line break, repeating the current line's leading blanks.

Parameters

edit: *Text_Edit
the text being edited.
Example↗
edit: Text_Edit;
defer free_text_edit(*edit);
set_contents(*edit, "    indented");
move_caret(*edit, 12);
insert_newline(*edit);
assert(contents(*edit) == "    indented\n    ");

See also