this repo has no description
13
fork

Configure Feed

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

TextView: fix DisplayWidth API

+4 -5
+4 -5
src/widgets/TextView.zig
··· 11 11 allocator: std.mem.Allocator, 12 12 buffer: *Buffer, 13 13 gd: *const Graphemes, 14 - wd: *const DisplayWidth.DisplayWidthData, 14 + wd: *const DisplayWidth, 15 15 16 16 pub fn write(self: @This(), bytes: []const u8) Error!usize { 17 17 try self.buffer.append(self.allocator, .{ ··· 34 34 pub const Content = struct { 35 35 bytes: []const u8, 36 36 gd: *const Graphemes, 37 - wd: *const DisplayWidth.DisplayWidthData, 37 + wd: *const DisplayWidth, 38 38 }; 39 39 40 40 pub const Style = struct { ··· 79 79 pub fn append(self: *@This(), allocator: std.mem.Allocator, content: Content) Error!void { 80 80 var cols: usize = self.last_cols; 81 81 var iter = Graphemes.Iterator.init(content.bytes, content.gd); 82 - const dw: DisplayWidth = .{ .data = content.wd }; 83 82 while (iter.next()) |g| { 84 83 try self.grapheme.append(allocator, .{ 85 84 .len = g.len, ··· 91 90 cols = 0; 92 91 continue; 93 92 } 94 - cols +|= dw.strWidth(cluster); 93 + cols +|= content.wd.strWidth(cluster); 95 94 } 96 95 try self.content.appendSlice(allocator, content.bytes); 97 96 self.last_cols = cols; ··· 125 124 self: *@This(), 126 125 allocator: std.mem.Allocator, 127 126 gd: *const Graphemes, 128 - wd: *const DisplayWidth.DisplayWidthData, 127 + wd: *const DisplayWidth, 129 128 ) BufferWriter.Writer { 130 129 return .{ 131 130 .context = .{