╭ changed ───────────╮ │src/ui/Repo/Refs.zig│ ╰────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────────────────────────────────────────────╮ │ 6 const xitui = xit.xitui; │ │ 7 const wgt = xitui.widget; │ │ 8 const layout = xitui.layout; │ │ 9 -const inp = xitui.input; │ │ 9 +const Key = xitui.input.Key; │ │10 const Grid = xitui.grid.Grid; │ │11 const Focus = xitui.focus.Focus; │ │12 +const inp = @import("../input.zig"); │ │13 │ │14 // how many refs one window of a column shows.│ │15 pub const page_size = 20; │ ╰──────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │271 }, root_focus); │ │272 } │ │273 │ │273 - pub fn input(self: *View, allocator: std.mem.Allocator, key: inp.Key, root_focus: *Focus) !void {│ │274 + pub fn input(self: *View, allocator: std.mem.Allocator, key: Key, root_focus: *Focus) !void { │ │275 _ = allocator; │ │276 // up/down (and the scroll wheel) move within the active column a row; │ │277 // page up/down and home/end jump; left/right switch columns, keeping the │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────╮ │278 // same row offset. the parent (Repo) intercepts up at the top row to move │ │279 // focus to the header. │ │280 + if (inp.rowDelta(key, self.columnRowCount())) |delta| { │ │281 + return self.moveRow(root_focus, delta); │ │282 + } │ │283 switch (key) { │ │280 - .arrow_up => try self.moveRow(root_focus, -1), │ │281 - .arrow_down => try self.moveRow(root_focus, 1), │ │284 .arrow_left => try self.switchColumn(root_focus, left_col), │ │285 .arrow_right => try self.switchColumn(root_focus, right_col), │ │284 - .page_down => try self.moveRow(root_focus, 10), │ │285 - .page_up => try self.moveRow(root_focus, -10), │ │286 - .end => try self.moveRow(root_focus, self.columnRowCount()), │ │287 - .home => try self.moveRow(root_focus, -self.columnRowCount()), │ │288 - .mouse => |mouse| switch (mouse.action) { │ │289 - .scroll => |dir| try self.moveRow(root_focus, if (dir == .up) -1 else 1),│ │290 - else => {}, │ │291 - }, │ │286 else => {}, │ │287 } │ │288 } │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯