this repo has no description
13
fork

Configure Feed

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

at 01605eebf65be21caa85ee9d840047f864553308 25 lines 704 B view raw
1const std = @import("std"); 2const grapheme = @import("grapheme"); 3const DisplayWidth = @import("DisplayWidth"); 4 5/// A thin wrapper around zg data 6const Unicode = @This(); 7 8width_data: DisplayWidth.DisplayWidthData, 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.DisplayWidthData.init(alloc), 14 }; 15} 16 17/// free all data 18pub fn deinit(self: *const Unicode) void { 19 self.width_data.deinit(); 20} 21 22/// creates a grapheme iterator based on str 23pub fn graphemeIterator(self: *const Unicode, str: []const u8) grapheme.Iterator { 24 return grapheme.Iterator.init(str, &self.width_data.g_data); 25}