╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Repo.zig ─────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
556 switch (direction) { 557 .up => { 558 switch (child.*) { 559 .repo_header => { 560 try child.input(allocator, key, root_focus); 561 }, 562 .stack => { 563 if (child.stack.getSelected()) |selected_widget| { 564 if (selected_widget.atTop(root_focus)) { 565 index = header_index; 566 } else { 567 try child.input(allocator, key, root_focus); 568 } 569 } 570 }, 571 else => {}, 572 } 573 }, 574 .down => { 575 switch (child.*) { 576 .repo_header => { 577 if (stack.getSelected()) |selected_widget| switch (selected_widget.*) { 578 .repo_files => |*v| if (v.focusHeader(root_focus)) return, 579 .repo_commits => |*v| if (v.focusHeader(root_focus)) return, 580 .repo_refs => |*v| if (v.focusHeader(root_focus)) return, 581 .repo_events => |*v| if (v.focusHeader(root_focus)) return, 582 .repo_undo => |*v| if (v.focusHeader(root_focus)) return, 583 else => {}, 584 }; 585 index = stack_index; 586 }, 587 .stack => { 588 try child.input(allocator, key, root_focus); 589 }, 590 else => {}, 591 } 592 }, 593 .none => { 594 try child.input(allocator, key, root_focus); 595 }, 596 } 597 598 if (index != current_index) { 599 root_focus.setFocus(self.box.children.keys()[index]); 600 } 601 } 602 } 603 } 604 605 pub fn clearGrid(self: *View) void { 606 self.box.clearGrid(); 607 } 608 609 pub fn getGrid(self: View) ?Grid { 610 return self.box.getGrid(); 611 } 612 613 pub fn getFocus(self: *View) *Focus { 614 return self.box.getFocus(); 615 } 616 }; 617