Text_Buffer module

replace

procedureextensionexperimentalsince 0.31.0Source

Replaces count bytes at offset with text, as one undo step.

Example↗
buffer: Text_Buffer;
defer free_buffer(*buffer);
set_text(*buffer, "hello world");
replace(*buffer, 6, 5, "there");
assert(buffer_to_string(*buffer, temp) == "hello there");
undo(*buffer);
assert(buffer_to_string(*buffer, temp) == "hello world");
replace :: (buffer: *Text_Buffer, offset: int, count: int, text: string)

Parameters

buffer: *Text_Buffer
offset: int
count: int
text: string

See also