╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Markdown.zig ─────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
412 const child_size: layout.Size = if (child_grid) |g| g.size else .{ .width = 0, .height = 0 }; 413 414 var grid = try Grid.init(allocator, .{ .width = marker_width + child_size.width, .height = @max(1, child_size.height) }); 415 errdefer grid.deinit(); 416 for (0..if (self.repeat) grid.size.height else 1) |y| { 417 var x: usize = 0; 418 var utf8 = (try std.unicode.Utf8View.init(self.marker)).iterator(); 419 while (utf8.nextCodepoint()) |rune| { 420 (try grid.cell(x, y)).style = self.style; 421 try grid.setRune(x, y, rune); 422 x += xitui.width.cellWidth(rune); 423 } 424 } 425 if (child_grid) |g| { 426 try grid.drawGrid(g, marker_width, 0); 427 try self.focus.addChild(allocator, self.child.getFocus(), g.size, marker_width, 0); 428 } 429 self.grid = grid; 430 } 431 432 pub fn input(self: *Gutter, allocator: std.mem.Allocator, key: Key, root_focus: *Focus) !void { 433 _ = self; 434 _ = allocator; 435 _ = key; 436 _ = root_focus; 437 } 438 439 pub fn clearGrid(self: *Gutter) void { 440 if (self.grid) |*grid| { 441 grid.deinit(); 442 self.grid = null; 443 } 444 self.child.clearGrid(); 445 } 446 447 pub fn getGrid(self: Gutter) ?Grid { 448 return self.grid; 449 } 450 451 pub fn getFocus(self: *Gutter) *Focus { 452 return self.focus; 453 } 454 }; 455