╭ changed ──────────────╮ │src/ui/Repo/Commits.zig│ ╰───────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭───────────────────────────────────────────────╮ │ 8 const xitui = xit.xitui; │ │ 9 const wgt = xitui.widget; │ │10 const layout = xitui.layout; │ │11 -const inp = xitui.input; │ │11 +const Key = xitui.input.Key; │ │12 const Grid = xitui.grid.Grid; │ │13 const Focus = xitui.focus.Focus; │ │14 +const inp = @import("../input.zig"); │ │15 │ │16 const SubHeader = @import("SubHeader.zig");│ │17 │ ╰───────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │620 sc.getFocus().version +%= 1; │ │621 } │ │622 │ │622 - pub fn input(self: *View, allocator: std.mem.Allocator, key: inp.Key, root_focus: *Focus) !void {│ │623 + pub fn input(self: *View, allocator: std.mem.Allocator, key: Key, root_focus: *Focus) !void { │ │624 _ = allocator; │ │625 if (self.diffActive()) { │ │626 try self.diffInput(key, root_focus); │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────╮ │629 } │ │630 } │ │631 │ │631 - fn listInput(self: *View, key: inp.Key, root_focus: *Focus) !void { │ │632 + fn listInput(self: *View, key: Key, root_focus: *Focus) !void { │ │633 // up/down (and the scroll wheel) move the selection a row; page up/down │ │634 // jump a fixed amount. right/Enter cross into the diff pane. Enter/clicks│ │635 // on the "next" row become navigation in the host before reaching here. │ ╰───────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────╮ │636 + if (inp.rowDelta(key, @intCast(self.listBox().children.count()))) |delta| {│ │637 + return self.moveSelection(root_focus, delta); │ │638 + } │ │639 switch (key) { │ │640 .enter => if (self.selectedCommitIndex() != null) │ │641 try self.focusDiff(root_focus) │ ╰────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │644 try self.session.navigate(route); │ │645 }, │ │646 .arrow_right => try self.focusDiff(root_focus), │ │643 - .arrow_down => try self.moveSelection(root_focus, 1), │ │644 - .arrow_up => try self.moveSelection(root_focus, -1), │ │645 - .page_down => try self.moveSelection(root_focus, 10), │ │646 - .page_up => try self.moveSelection(root_focus, -10), │ │647 - .end => try self.moveSelection(root_focus, @intCast(self.listBox().children.count())), │ │648 - .home => try self.moveSelection(root_focus, -@as(isize, @intCast(self.listBox().children.count()))),│ │649 - .mouse => |mouse| switch (mouse.action) { │ │650 - .scroll => |dir| try self.moveSelection(root_focus, if (dir == .up) -1 else 1), │ │651 - else => {}, │ │652 - }, │ │647 else => {}, │ │648 } │ │649 } │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────╮ │650 │ │657 - fn diffInput(self: *View, key: inp.Key, root_focus: *Focus) !void { │ │651 + fn diffInput(self: *View, key: Key, root_focus: *Focus) !void { │ │652 const sc = self.diffScroll(); │ │653 switch (key) { │ │654 // left scrolls horizontally, then leaves for the list once flush left.│ ╰────────────────────────────────────────────────────────────────────────────────────────╯