╭ changed ────╮ │build.zig.zon│ ╰─────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ 3 .version = "0.0.0", │ │ 4 .dependencies = .{ │ │ 5 .xit = .{ │ │ 6 - .url = "git+https://github.com/xit-vcs/xit#33135ce2db0769c3b91dccc99b6a1808d576fd0c",│ │ 7 - .hash = "xit-0.0.0-Ub3nDMB6UAGO82WSukW82YY-OdAl-FylLLx6SX5wlQSq", │ │ 6 + .url = "git+https://github.com/xit-vcs/xit#94a1a29da09ccffd18ef57451b0ced33d9e21cd9",│ │ 7 + .hash = "xit-0.0.0-Ub3nDFNsUAHyTDMlk3x-R7AikTDk9s4jJg__2F2ZtieH", │ │ 8 }, │ │ 9 }, │ │10 .paths = .{ │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─╮ │src/ui.zig│ ╰──────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1124 if (next == @as(usize, @intCast(cur))) return; │ │1125 root_focus.setFocus(keys[next]); │ │1126 if (box.children.values()[next].rect) |rect| scroll.scrollToRect(rect); │ │1127 -} │ │1128 - │ │1129 -// keep a scroll within its content, using the last build's grids. the scroll │ │1130 -// bar's reserved column/row isn't part of the content viewport, so exclude it │ │1131 -// (as scrollToRect does) or the last column/row stays unreachable. │ │1132 -pub fn clampScroll(sc: *wgt.Scroll(Widget)) void { │ │1133 - const vp = sc.grid orelse return; │ │1134 - const content = sc.child.box.grid orelse return; │ │1135 - const view_w = vp.size.width - sc.bar_w; │ │1136 - const view_h = vp.size.height - sc.bar_h; │ │1137 - const max_y: isize = if (content.size.height > view_h) @intCast(content.size.height - view_h) else 0;│ │1138 - const max_x: isize = if (content.size.width > view_w) @intCast(content.size.width - view_w) else 0; │ │1139 - sc.y = std.math.clamp(sc.y, 0, max_y); │ │1140 - sc.x = std.math.clamp(sc.x, 0, max_x); │ │1127 } │ │1128 │ │1129 pub const FlowBox = struct { │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──────────────╮ │src/ui/Repo/Commits.zig│ ╰───────────────────────╯ ╭────────────────────────────────────────────────────────────╮ │656 .arrow_left => { │ │657 if (sc.x > 0) { │ │658 sc.x -= 1; │ │659 - ui.clampScroll(self.diffScroll()); │ │659 + self.diffScroll().clampToContent();│ │660 } else try self.focusList(root_focus); │ │661 }, │ │662 .arrow_right => { │ ╰────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────╮ │663 sc.x += 1; │ │664 - ui.clampScroll(self.diffScroll()); │ │664 + self.diffScroll().clampToContent(); │ │665 }, │ │666 .arrow_up => try self.moveDiff(root_focus, -1), │ │667 .arrow_down => try self.moveDiff(root_focus, 1),│ ╰─────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────╮ │698 │ │699 const sc = self.diffScroll(); │ │700 sc.y += delta * 5; // magnify because it's a line count│ │701 - ui.clampScroll(self.diffScroll()); │ │701 + self.diffScroll().clampToContent(); │ │702 if (in_range and self.hunkVisible(@intCast(target))) { │ │703 root_focus.setFocus(keys[@intCast(target)]); │ │704 } │ ╰────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────╮ │716 if (self.session.is_terminal) { │ │717 const sc = self.diffScroll(); │ │718 sc.y += delta * 5; // magnify because it's a line count│ │719 - ui.clampScroll(self.diffScroll()); │ │719 + self.diffScroll().clampToContent(); │ │720 try self.focusVisible(root_focus, delta > 0); │ │721 } else { │ │722 const inner = self.diffInner(); │ ╰────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────╮ │737 if (self.session.is_terminal) { │ │738 const sc = self.diffScroll(); │ │739 sc.y = if (to_end) std.math.maxInt(isize) else 0; │ │740 - ui.clampScroll(self.diffScroll()); │ │740 + self.diffScroll().clampToContent(); │ │741 } │ │742 root_focus.setFocus(if (to_end) keys[keys.len - 1] else keys[0]);│ │743 } │ ╰──────────────────────────────────────────────────────────────────────────────╯ ╭ changed ────────────╮ │src/ui/Repo/Files.zig│ ╰─────────────────────╯ ╭──────────────────────────────────────────────────────────────────╮ │661 if (on_content) { │ │662 if (sc.x > 0) { │ │663 sc.x -= 1; │ │664 - ui.clampScroll(self.detailScroll()); │ │664 + self.detailScroll().clampToContent();│ │665 } else try self.focusList(root_focus); │ │666 } else if (!self.moveNav(root_focus, -1)) { │ │667 try self.focusList(root_focus); │ ╰──────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────╮ │670 .arrow_right => { │ │671 if (on_content) { │ │672 sc.x += 1; │ │673 - ui.clampScroll(self.detailScroll()); │ │673 + self.detailScroll().clampToContent();│ │674 } else _ = self.moveNav(root_focus, 1); │ │675 }, │ │676 .arrow_up => { │ ╰──────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────╮ │677 if (on_content) { │ │678 if (self.session.is_terminal and sc.y > 0) { │ │679 sc.y -= 1; │ │680 - ui.clampScroll(self.detailScroll()); │ │680 + self.detailScroll().clampToContent(); │ │681 } else self.focusNav(root_focus); // cross up to the links│ │682 } │ │683 }, │ ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯