From 4e3a53c5360836be144d0ed541c2628e1fcbf0e8 Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Mon, 29 Apr 2024 14:21:03 -0500 Subject: [PATCH] widgets(textinput): fix grapheme API --- src/widgets/TextInput.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/TextInput.zig b/src/widgets/TextInput.zig index 04fec4f..9fee297 100644 --- a/src/widgets/TextInput.zig +++ b/src/widgets/TextInput.zig @@ -79,7 +79,7 @@ pub fn insertSliceAtCursor(self: *TextInput, data: []const u8) !void { var iter = self.unicode.graphemeIterator(data); var byte_offset_to_cursor = self.byteOffsetToCursor(); 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; self.cursor_idx += 1; self.grapheme_count += 1;