╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Repo.zig ─────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
509 const child = &self.box.children.values()[current_index].widget; 510 var index = current_index; 511 512 const direction = inp.vertDirection(key); 513 514 switch (direction) { 515 .up => { 516 switch (child.*) { 517 .repo_header => { 518 try child.input(allocator, key, root_focus); 519 }, 520 .stack => { 521 if (child.stack.getSelected()) |selected_widget| { 522 if (selected_widget.atTop(root_focus)) { 523 index = header_index; 524 } else { 525 try child.input(allocator, key, root_focus); 526 } 527 } 528 }, 529 else => {}, 530 } 531 }, 532 .down => { 533 switch (child.*) { 534 .repo_header => { 535 if (stack.getSelected()) |selected_widget| switch (selected_widget.*) { 536 .repo_files => |*v| if (v.focusHeader(root_focus)) return, 537 .repo_commits => |*v| if (v.focusHeader(root_focus)) return, 538 .repo_refs => |*v| if (v.focusHeader(root_focus)) return, 539 .repo_events => |*v| if (v.focusHeader(root_focus)) return, 540 .repo_undo => |*v| if (v.focusHeader(root_focus)) return, 541 else => {}, 542 }; 543 index = stack_index; 544 }, 545 .stack => { 546 try child.input(allocator, key, root_focus); 547 }, 548 else => {}, 549 } 550 }, 551 .none => { 552 try child.input(allocator, key, root_focus); 553 }, 554 } 555 556 if (index != current_index) { 557 root_focus.setFocus(self.box.children.keys()[index]); 558 } 559 } 560 } 561 } 562 563 pub fn clearGrid(self: *View) void { 564 self.box.clearGrid(); 565 } 566 567 pub fn getGrid(self: View) ?Grid { 568 return self.box.getGrid(); 569 } 570 571 pub fn getFocus(self: *View) *Focus { 572 return self.box.getFocus(); 573 } 574 }; 575