this repo has no description
13
fork

Configure Feed

Select the types of activity you want to include in your feed.

at b698a3641da7f3886bde4aeda7fcecc8d3642580 25 lines 691 B view raw
1const std = @import("std"); 2const Graphemes = @import("Graphemes"); 3const DisplayWidth = @import("DisplayWidth"); 4 5/// A thin wrapper around zg data 6const Unicode = @This(); 7 8width_data: DisplayWidth, 9 10/// initialize all unicode data vaxis may possibly need 11pub fn init(alloc: std.mem.Allocator) !Unicode { 12 return .{ 13 .width_data = try DisplayWidth.init(alloc), 14 }; 15} 16 17/// free all data 18pub fn deinit(self: *const Unicode, alloc: std.mem.Allocator) void { 19 self.width_data.deinit(alloc); 20} 21 22/// creates a grapheme iterator based on str 23pub fn graphemeIterator(self: *const Unicode, str: []const u8) Graphemes.Iterator { 24 return self.width_data.graphemes.iterator(str); 25}