widgets(text_input): add realLength fn

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
This commit is contained in:
Tim Culverhouse 2024-08-12 21:18:12 -05:00
parent 453203553e
commit 707c050a76

View file

@ -418,6 +418,11 @@ pub const Buffer = struct {
@memcpy(buf[0..first_half.len], first_half);
@memcpy(buf[first_half.len..], second_half);
self.clearAndFree();
return buf;
}
pub fn realLength(self: *const Buffer) usize {
return self.firstHalf().len + self.secondHalf().len;
}
};