this repo has no description
13
fork

Configure Feed

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

cell: change width type from usize to u8

Cell is an often used structure, this should come with some decent
memory savings since there are cells stored twice (Screen and
InternalScreen).

+8 -8
+1 -1
src/Cell.zig
··· 23 23 /// will measure the same width. This can be ensure by using the gwidth method 24 24 /// included in libvaxis. If width is 0, libvaxis will measure the glyph at 25 25 /// render time 26 - width: usize = 1, 26 + width: u8 = 1, 27 27 }; 28 28 29 29 pub const CursorShape = enum {
+3 -3
src/Window.zig
··· 306 306 if (opts.commit) self.writeCell(col, row, .{ 307 307 .char = .{ 308 308 .grapheme = s, 309 - .width = w, 309 + .width = @intCast(w), 310 310 }, 311 311 .style = segment.style, 312 312 .link = segment.link, ··· 383 383 if (opts.commit) self.writeCell(col, row, .{ 384 384 .char = .{ 385 385 .grapheme = s, 386 - .width = w, 386 + .width = @intCast(w), 387 387 }, 388 388 .style = segment.style, 389 389 .link = segment.link, ··· 420 420 if (opts.commit) self.writeCell(col, row, .{ 421 421 .char = .{ 422 422 .grapheme = s, 423 - .width = w, 423 + .width = @intCast(w), 424 424 }, 425 425 .style = segment.style, 426 426 .link = segment.link,
+2 -2
src/widgets/TextInput.zig
··· 172 172 win.writeCell(col, 0, .{ 173 173 .char = .{ 174 174 .grapheme = g, 175 - .width = w, 175 + .width = @intCast(w), 176 176 }, 177 177 .style = style, 178 178 }); ··· 199 199 win.writeCell(col, 0, .{ 200 200 .char = .{ 201 201 .grapheme = g, 202 - .width = w, 202 + .width = @intCast(w), 203 203 }, 204 204 .style = style, 205 205 });
+2 -2
src/widgets/terminal/Terminal.zig
··· 295 295 while (iter.next()) |g| { 296 296 const gr = g.bytes(str); 297 297 // TODO: use actual instead of .unicode 298 - const w = try vaxis.gwidth.gwidth(gr, .unicode, &self.unicode.width_data); 298 + const w = vaxis.gwidth.gwidth(gr, .unicode, &self.unicode.width_data); 299 299 try self.back_screen.print(gr, @truncate(w), self.mode.autowrap); 300 300 } 301 301 }, ··· 511 511 var iter = seq.iterator(u16); 512 512 const n = iter.next() orelse 1; 513 513 // TODO: maybe not .unicode 514 - const w = try vaxis.gwidth.gwidth(self.last_printed, .unicode, &self.unicode.width_data); 514 + const w = vaxis.gwidth.gwidth(self.last_printed, .unicode, &self.unicode.width_data); 515 515 var i: usize = 0; 516 516 while (i < n) : (i += 1) { 517 517 try self.back_screen.print(self.last_printed, @truncate(w), self.mode.autowrap);