From 037a301bd649b3a5efbada0be4a16ac137e3deaa Mon Sep 17 00:00:00 2001 From: 00JCIV00 Date: Fri, 29 Mar 2024 20:35:54 -0400 Subject: [PATCH] Added missing 'assert' definition for TextInput --- src/widgets/TextInput.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/widgets/TextInput.zig b/src/widgets/TextInput.zig index dda137d..5069e2a 100644 --- a/src/widgets/TextInput.zig +++ b/src/widgets/TextInput.zig @@ -6,6 +6,7 @@ const Window = @import("../Window.zig"); const GapBuffer = @import("gap_buffer").GapBuffer; const Unicode = @import("../Unicode.zig"); +const assert = std.debug.assert; const log = std.log.scoped(.text_input); const TextInput = @This(); @@ -88,7 +89,7 @@ pub fn insertSliceAtCursor(self: *TextInput, data: []const u8) !void { pub fn sliceToCursor(self: *TextInput, buf: []u8) []const u8 { const offset = self.byteOffsetToCursor(); - assert(offset <= buf.len); // provided buf was too small + assert(offset <= buf.len); // provided buf was too small if (offset <= self.buf.items.len) { @memcpy(buf[0..offset], self.buf.items[0..offset]);