widgets(text_input): add realLength fn
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
This commit is contained in:
parent
453203553e
commit
707c050a76
1 changed files with 5 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue