╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ──────────────╮ │src/ui/Repo/Commits.zig│ ╰───────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────╮ │224 - return self.scroll.getFocus(); │ │690 + return self.box.getFocus(); │ │691 } │ │692 │ │227 - pub fn getSelectedIndex(self: View) ?usize { │ │228 - const box = &self.scroll.child.box; │ │229 - const child_id = box.focus.child_id orelse return null; │ │230 - return box.children.getIndex(child_id); │ │693 + // for the parent's "scroll up at the top jumps to the header" check. in the │ │694 + // diff pane that means the first hunk is focused and the diff can't scroll up │ │695 + // any further; otherwise up-arrow stays in the pane (scrolling or moving │ │696 + // between hunks). when the list holds focus, report its selection directly. │ │697 + pub fn getSelectedIndex(self: *View) ?usize { │ │698 + if (self.diffActive()) { │ │699 + const inner = self.diffInner(); │ │700 + const cid = inner.getFocus().child_id orelse return 1; │ │701 + const first_focused = inner.children.count() > 0 and cid == inner.children.keys()[0];│ │702 + return if (first_focused and self.diffScroll().y == 0) 0 else 1; │ │703 + } │ │704 + const lb = self.listBox(); │ │705 + const cid = lb.getFocus().child_id orelse return null; │ │706 + return lb.children.getIndex(cid); │ │707 } │ │708 }; │ │709 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯