this repo has no description
13
fork

Configure Feed

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

zg: remove grapheme_data init

WidthData already includes grapheme_data. We were double allocating it!

+7 -10
+2 -2
build.zig.zon
··· 9 9 .lazy = true, 10 10 }, 11 11 .zg = .{ 12 - .url = "git+https://codeberg.org/dude_the_builder/zg?ref=master#689ab6b83d08c02724b99d199d650ff731250998", 13 - .hash = "12200d1ce5f9733a9437415d85665ad5fbc85a4d27689fd337fecad8014acffe3aa5", 12 + .url = "git+https://codeberg.org/dude_the_builder/zg#7ddce488e074c3f052949ba513a340446cea86e9", 13 + .hash = "12205e2e7108385a1ec280b6365166e902a690d6a0e8fcc015fdea62d63cf79be8ec", 14 14 }, 15 15 .libxev = .{ 16 16 .url = "git+https://github.com/mitchellh/libxev#f6a672a78436d8efee1aa847a43a900ad773618b",
+1 -1
src/Loop.zig
··· 45 45 if (self.thread) |_| return; 46 46 self.thread = try std.Thread.spawn(.{}, Self.ttyRun, .{ 47 47 self, 48 - &self.vaxis.unicode.grapheme_data, 48 + &self.vaxis.unicode.width_data.g_data, 49 49 self.vaxis.opts.system_clipboard_allocator, 50 50 }); 51 51 }
+1 -4
src/Unicode.zig
··· 5 5 /// A thin wrapper around zg data 6 6 const Unicode = @This(); 7 7 8 - grapheme_data: grapheme.GraphemeData, 9 8 width_data: DisplayWidth.DisplayWidthData, 10 9 11 10 /// initialize all unicode data vaxis may possibly need 12 11 pub fn init(alloc: std.mem.Allocator) !Unicode { 13 12 return .{ 14 - .grapheme_data = try grapheme.GraphemeData.init(alloc), 15 13 .width_data = try DisplayWidth.DisplayWidthData.init(alloc), 16 14 }; 17 15 } 18 16 19 17 /// free all data 20 18 pub fn deinit(self: *const Unicode) void { 21 - self.grapheme_data.deinit(); 22 19 self.width_data.deinit(); 23 20 } 24 21 25 22 /// creates a grapheme iterator based on str 26 23 pub fn graphemeIterator(self: *const Unicode, str: []const u8) grapheme.Iterator { 27 - return grapheme.Iterator.init(str, &self.grapheme_data); 24 + return grapheme.Iterator.init(str, &self.width_data.g_data); 28 25 }
+1 -1
src/aio.zig
··· 116 116 } 117 117 118 118 var parser: vaxis.Parser = .{ 119 - .grapheme_data = &vx.unicode.grapheme_data, 119 + .grapheme_data = &vx.unicode.width_data.g_data, 120 120 }; 121 121 122 122 const file: std.fs.File = .{ .handle = tty.fd };
+1 -1
src/widgets/terminal/Terminal.zig
··· 291 291 292 292 switch (event) { 293 293 .print => |str| { 294 - var iter = grapheme.Iterator.init(str, &self.unicode.grapheme_data); 294 + var iter = grapheme.Iterator.init(str, &self.unicode.width_data.g_data); 295 295 while (iter.next()) |g| { 296 296 const gr = g.bytes(str); 297 297 // TODO: use actual instead of .unicode
+1 -1
src/xev.zig
··· 76 76 .callback = callback, 77 77 .ud = userdata, 78 78 .vx = vaxis, 79 - .parser = .{ .grapheme_data = &vaxis.unicode.grapheme_data }, 79 + .parser = .{ .grapheme_data = &vaxis.unicode.width_data.g_data }, 80 80 }; 81 81 82 82 self.file.read(