terminal: print must use codepoint() now to work with placeholders

This commit is contained in:
Mitchell Hashimoto
2024-07-25 10:03:44 -07:00
parent bb1a9bf532
commit deacb10fb1
2 changed files with 3 additions and 3 deletions

View File

@ -281,7 +281,7 @@ pub fn print(self: *Terminal, c: u21) !void {
// column. Otherwise, we need to check if there is text to
// figure out if we're attaching to the prev or current.
if (self.screen.cursor.x != right_limit - 1) break :left 1;
break :left @intFromBool(!self.screen.cursor.page_cell.hasText());
break :left @intFromBool(self.screen.cursor.page_cell.codepoint() == 0);
};
// If the previous cell is a wide spacer tail, then we actually
@ -299,7 +299,7 @@ pub fn print(self: *Terminal, c: u21) !void {
// If our cell has no content, then this is a new cell and
// necessarily a grapheme break.
if (!prev.cell.hasText()) break :grapheme;
if (prev.cell.codepoint() == 0) break :grapheme;
const grapheme_break = brk: {
var state: unicode.GraphemeBreakState = .{};

View File

@ -1161,7 +1161,7 @@ pub const Page = struct {
pub fn appendGrapheme(self: *Page, row: *Row, cell: *Cell, cp: u21) Allocator.Error!void {
defer self.assertIntegrity();
if (comptime std.debug.runtime_safety) assert(cell.hasText());
if (comptime std.debug.runtime_safety) assert(cell.codepoint() != 0);
const cell_offset = getOffset(Cell, self.memory, cell);
var map = self.grapheme_map.map(self.memory);