widgets(textinput): fix grapheme API
This commit is contained in:
parent
8a71cd4c85
commit
4e3a53c536
1 changed files with 1 additions and 1 deletions
|
@ -79,7 +79,7 @@ pub fn insertSliceAtCursor(self: *TextInput, data: []const u8) !void {
|
||||||
var iter = self.unicode.graphemeIterator(data);
|
var iter = self.unicode.graphemeIterator(data);
|
||||||
var byte_offset_to_cursor = self.byteOffsetToCursor();
|
var byte_offset_to_cursor = self.byteOffsetToCursor();
|
||||||
while (iter.next()) |text| {
|
while (iter.next()) |text| {
|
||||||
try self.buf.insertSliceBefore(byte_offset_to_cursor, text.slice(data));
|
try self.buf.insertSliceBefore(byte_offset_to_cursor, text.bytes(data));
|
||||||
byte_offset_to_cursor += text.len;
|
byte_offset_to_cursor += text.len;
|
||||||
self.cursor_idx += 1;
|
self.cursor_idx += 1;
|
||||||
self.grapheme_count += 1;
|
self.grapheme_count += 1;
|
||||||
|
|
Loading…
Reference in a new issue