╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ────────────╮ │src/ui/Repo/Files.zig│ ╰─────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────╮ │732 // move focus `delta` rows within the nav box; returns false (without moving) │ │733 // when that would step off either end. │ │734 fn moveNav(self: *View, root_focus: *Focus, delta: isize) bool { │ │741 - const nav = self.navBox(); │ │742 - const keys = nav.children.keys(); │ │743 - const cur_id = nav.getFocus().child_id orelse return false; │ │744 - const cur: isize = @intCast(nav.children.getIndex(cur_id) orelse return false); │ │735 + const nav_box = self.navBox(); │ │736 + const keys = nav_box.children.keys(); │ │737 + const cur_id = nav_box.getFocus().child_id orelse return false; │ │738 + const cur: isize = @intCast(nav_box.children.getIndex(cur_id) orelse return false);│ │739 const target = cur + delta; │ │740 if (target < 0 or target >= @as(isize, @intCast(keys.len))) return false; │ │741 root_focus.setFocus(keys[@intCast(target)]); │ ╰────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────────╮ │src/ui/Repo/Header.zig│ ╰──────────────────────╯ ╭────────────────────────────────────╮ │ 4 const xitui = xit.xitui; │ │ 5 const wgt = xitui.widget; │ │ 6 const layout = xitui.layout; │ │ 7 -const inp = xitui.input; │ │ 7 +const Key = xitui.input.Key; │ │ 8 const Grid = xitui.grid.Grid; │ │ 9 const Focus = xitui.focus.Focus;│ │10 │ ╰────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │247 try self.box.build(allocator, constraint, root_focus); │ │248 } │ │249 │ │250 - pub fn input(self: *View, allocator: std.mem.Allocator, key: inp.Key, root_focus: *Focus) !void {│ │250 + pub fn input(self: *View, allocator: std.mem.Allocator, key: Key, root_focus: *Focus) !void { │ │251 _ = allocator; │ │252 const current_tab = self.currentTabIndex() orelse return; │ │253 var new_tab = current_tab; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ───────────╮ │src/ui/Repo/Refs.zig│ ╰────────────────────╯ ╭──────────────────────────────────────────────────╮ │ 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 } │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ────────────────╮ │src/ui/Repo/SubHeader.zig│ ╰─────────────────────────╯ ╭────────────────────────────────────╮ │ 4 const xitui = xit.xitui; │ │ 5 const wgt = xitui.widget; │ │ 6 const layout = xitui.layout; │ │ 7 -const inp = xitui.input; │ │ 7 +const Key = xitui.input.Key; │ │ 8 const Grid = xitui.grid.Grid; │ │ 9 const Focus = xitui.focus.Focus;│ │10 │ ╰────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │45 }, root_focus); │ │46 } │ │47 │ │48 - pub fn input(self: *View, allocator: std.mem.Allocator, key: inp.Key, root_focus: *Focus) !void {│ │48 + pub fn input(self: *View, allocator: std.mem.Allocator, key: Key, root_focus: *Focus) !void { │ │49 _ = self; │ │50 _ = allocator; │ │51 _ = key; │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──────────╮ │src/ui/Settings.zig│ ╰───────────────────╯ ╭────────────────────────────────────╮ │ 4 const xitui = xit.xitui; │ │ 5 const wgt = xitui.widget; │ │ 6 const layout = xitui.layout; │ │ 7 -const inp = xitui.input; │ │ 7 +const Key = xitui.input.Key; │ │ 8 const Grid = xitui.grid.Grid; │ │ 9 const Focus = xitui.focus.Focus;│ │10 │ ╰────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ 99 try self.center.build(allocator, constraint, root_focus); │ │100 } │ │101 │ │102 - pub fn input(self: *View, allocator: std.mem.Allocator, key: inp.Key, root_focus: *Focus) !void {│ │102 + pub fn input(self: *View, allocator: std.mem.Allocator, key: Key, root_focus: *Focus) !void { │ │103 _ = allocator; │ │104 if (self.session.data.user_id == null) return; // blank/disabled when logged out │ │105 switch (key) { │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯