···6677pub const Character = struct {
88 grapheme: []const u8 = " ",
99+ /// width should only be provided when the application is sure the terminal
1010+ /// will meeasure the same width. This can be ensure by using the gwidth method
1111+ /// included in libvaxis. If width is 0, libvaxis will measure the glyph at
1212+ /// render time
913 width: usize = 1,
1014};
1115
+6-2
src/vaxis.zig
···294294 const cell = self.screen.buf[i];
295295 defer {
296296 // advance by the width of this char mod 1
297297- const method: gwidth.Method = if (self.caps.unicode) .unicode else .wcwidth;
298298- const w = gwidth.gwidth(cell.char.grapheme, method) catch 1;
297297+ const w = blk: {
298298+ if (cell.char.width != 0) break :blk cell.char.width;
299299+300300+ const method: gwidth.Method = if (self.caps.unicode) .unicode else .wcwidth;
301301+ break :blk gwidth.gwidth(cell.char.grapheme, method) catch 1;
302302+ };
299303 var j = i + 1;
300304 while (j < i + w) : (j += 1) {
301305 self.screen_last.buf[j].skipped = true;