╭ changed ───────╮ │src/ui/Title.zig│ ╰────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭────────────────────────────────────╮ │ 9 const Focus = xitui.focus.Focus;│ │10 │ │11 content: []const u8, │ │12 -width: usize, │ │12 │ │13 const Self = @This(); │ │14 │ ╰────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────╮ │15 pub fn init(arena: *std.heap.ArenaAllocator, orig_content: []const u8) !Self {│ │17 - const rendered = try renderTitle(arena.allocator(), orig_content); │ │18 - // count cells in the first row: one per UTF-8 codepoint start │ │19 - var width: usize = 0; │ │20 - for (rendered) |byte| { │ │21 - if (byte == '\n') break; │ │22 - if (byte & 0xC0 != 0x80) width += 1; │ │23 - } │ │16 return .{ │ │25 - .content = rendered, │ │26 - .width = width, │ │17 + .content = try renderTitle(arena.allocator(), orig_content), │ │18 }; │ │19 } │ │20 │ ╰──────────────────────────────────────────────────────────────────────────────────╯