╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Repo.zig ─────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
405 .up => { 406 switch (child.*) { 407 .repo_header => { 408 try child.input(allocator, key, root_focus); 409 }, 410 .stack => { 411 if (child.stack.getSelected()) |selected_widget| { 412 const at_top = switch (selected_widget.*) { 413 .repo_files => |*v| v.getSelectedIndex() == 0, 414 .repo_commits => |*v| v.getSelectedIndex() == 0, 415 .repo_refs => |*v| v.getSelectedIndex() == 0, 416 .repo_issues => |*v| v.getSelectedIndex() == 0, 417 .repo_patches => |*v| v.getSelectedIndex() == 0, 418 .repo_discussions => |*v| v.getSelectedIndex() == 0, 419 .repo_events => |*v| v.getSelectedIndex() == 0, 420 .home_settings => |*v| v.getSelectedIndex() == 0, 421 .home_auth => |*v| v.getSelectedIndex() == 0, 422 .quit => |*v| v.getSelectedIndex() == 0, 423 else => false, 424 }; 425 if (at_top) { 426 index = header_index; 427 } else { 428 try child.input(allocator, key, root_focus); 429 } 430 } 431 }, 432 else => {}, 433 } 434 }, 435 .down => { 436 switch (child.*) { 437 .repo_header => { 438 if (stack.getSelected()) |selected_widget| switch (selected_widget.*) { 439 .repo_files => |*v| if (v.focusGitRemote(root_focus)) return, 440 .repo_commits => |*v| if (v.focusGitRemote(root_focus)) return, 441 else => {}, 442 }; 443 index = stack_index; 444 }, 445 .stack => { 446 try child.input(allocator, key, root_focus); 447 }, 448 else => {}, 449 } 450 }, 451 .none => { 452 try child.input(allocator, key, root_focus); 453 }, 454 } 455 456 if (index != current_index) { 457 root_focus.setFocus(self.box.children.keys()[index]); 458 } 459 } 460 } 461 } 462 463 pub fn clearGrid(self: *View) void { 464 self.box.clearGrid(); 465 } 466 467 pub fn getGrid(self: View) ?Grid { 468 return self.box.getGrid(); 469 } 470 471 pub fn getFocus(self: *View) *Focus { 472 return self.box.getFocus(); 473 } 474 }; 475