╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Repo.zig ─────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
633 const stack = &self.box.children.values()[stack_index].widget.stack; 634 if (self.getFocus().child_id) |child_id| { 635 if (self.box.children.getIndex(child_id)) |current_index| { 636 const child = &self.box.children.values()[current_index].widget; 637 var index = current_index; 638 639 const direction = inp.vertDirection(key); 640 641 switch (direction) { 642 .up => { 643 switch (child.*) { 644 .repo_header => { 645 try child.input(allocator, key, root_focus); 646 }, 647 .stack => { 648 if (child.stack.getSelected()) |selected_widget| { 649 if (selected_widget.atTop(root_focus)) { 650 index = header_index; 651 } else { 652 try child.input(allocator, key, root_focus); 653 } 654 } 655 }, 656 else => {}, 657 } 658 }, 659 .down => { 660 switch (child.*) { 661 .repo_header => { 662 if (stack.getSelected()) |selected_widget| switch (selected_widget.*) { 663 .repo_files => |*v| if (v.focusHeader(root_focus)) return, 664 .repo_commits => |*v| if (v.focusHeader(root_focus)) return, 665 .repo_refs => |*v| if (v.focusHeader(root_focus)) return, 666 .repo_events => |*v| if (v.focusHeader(root_focus)) return, 667 .repo_undo => |*v| if (v.focusHeader(root_focus)) return, 668 .repo_settings => |*v| if (v.focusHeader(root_focus)) return, 669 .user_notifications => |*v| if (v.focusHeader(root_focus)) return, 670 else => {}, 671 }; 672 index = stack_index; 673 }, 674 .stack => { 675 try child.input(allocator, key, root_focus); 676 }, 677 else => {}, 678 } 679 }, 680 .none => { 681 try child.input(allocator, key, root_focus); 682 }, 683 } 684 685 if (index != current_index) { 686 root_focus.setFocus(self.box.children.keys()[index]); 687 } 688 } 689 } 690 } 691 692 pub fn clearGrid(self: *View) void { 693 self.box.clearGrid(); 694 } 695 696 pub fn getGrid(self: View) ?Grid { 697 return self.box.getGrid(); 698 } 699 700 pub fn getFocus(self: *View) *Focus { 701 return self.box.getFocus(); 702 } 703 }; 704