UI module

insert_tab

procedureextensionexperimentalsince 0.31.0Source

Insert spaces up to the next multiple of width columns.

Example↗
edit: Text_Edit;
defer free_text_edit(*edit);
set_contents(*edit, "ab");
move_caret(*edit, 2);
insert_tab(*edit, 4);
assert(contents(*edit) == "ab  ");
insert_tab :: (edit: *Text_Edit, width: int)

Insert spaces up to the next multiple of width columns.

Parameters

edit: *Text_Edit
the text being edited.
width: int
the tab stop spacing in columns.
Example↗
edit: Text_Edit;
defer free_text_edit(*edit);
set_contents(*edit, "ab");
move_caret(*edit, 2);
insert_tab(*edit, 4);
assert(contents(*edit) == "ab  ");

See also