╭ changed ────────────╮ │src/ui/Repo/Files.zig│ ╰─────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │266 const link = if (entry.is_dir) │ │267 try dirLink(session.page_arena, data, path) │ │268 else │ │269 - try fileLink(session.page_arena, data, path, entry.loaded); │ │269 + try fileLink(session.page_arena, data, path, entry.loaded, lineNumber(entry.window_start));│ │270 try addRow(allocator, &list_box, label, link); │ │271 } │ │272 // select the file the route named, else prefer a README so its │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │444 │ │445 // swap the detail pane to the selected entry when the selection changes. │ │446 try self.refreshDetail(allocator); │ │447 - │ │448 - // mirror the selected file into the url so it updates as the selection │ │449 - // moves, but only while focus is inside this view (so landing on the tab │ │450 - // keeps the page's base route). │ │451 - if (root_focus.grandchild_id) |g| { │ │452 - if (self.box.getFocus().children.contains(g)) { │ │453 - var buf: [ui.RoutablePage.repo_route_max_len]u8 = undefined; │ │454 - var sel_path = self.data.dir; │ │455 - var sel_line: usize = 0; │ │456 - if (self.selectedEntry()) |entry| { │ │457 - if (!entry.is_dir and entry.loaded) { │ │458 - sel_path = if (self.data.dir.len == 0) │ │459 - entry.name │ │460 - else │ │461 - std.fmt.bufPrint(&buf, "{s}/{s}", .{ self.data.dir, entry.name }) catch self.data.dir; │ │462 - sel_line = lineNumber(entry.window_start); │ │463 - } │ │464 - } │ │465 - if (ui.RoutablePage.repoFilesRoute(self.data.identity, self.data.ref_or_oid, self.data.ref_or_oid_value, sel_path, sel_line)) |route|│ │466 - self.session.data.current_page = route; │ │467 - } │ │468 - } │ │447 │ │448 // the selected list row shows a border (the focused TextBox upgrades it │ │449 // to a double border itself); the rest stay borderless. │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │528 // the placeholder carries the file's "a:" link, so enter │ │529 // (or a click) here loads the file like on its list row. │ │530 const path = try childDir(self.session.page_arena.allocator(), self.data.dir, entry.name);│ │553 - const link = try fileLink(self.session.page_arena, self.data, path, false); │ │531 + const link = try fileLink(self.session.page_arena, self.data, path, false, 0); │ │532 try self.addContentBox(allocator, inner, "(press enter to load this file)", link); │ │533 } else if (entry.is_binary) { │ │534 try self.addContentBox(allocator, inner, "(binary file)", ""); │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │812 // (crossPageLink ignores it, so a click selects the row in place and shows its │ │813 // contents); an unloaded file gets an "a:" link, so activating it reloads the │ │814 // page with that file selected and its content read. │ │837 -fn fileLink(page_arena: *std.heap.ArenaAllocator, data: *const Self, path: []const u8, loaded: bool) ![]const u8 { │ │838 - const route = ui.RoutablePage.repoFilesRoute(data.identity, data.ref_or_oid, data.ref_or_oid_value, path, 0) orelse return error.RouteTooLong; │ │815 +fn fileLink(page_arena: *std.heap.ArenaAllocator, data: *const Self, path: []const u8, loaded: bool, line: usize) ![]const u8 { │ │816 + const route = ui.RoutablePage.repoFilesRoute(data.identity, data.ref_or_oid, data.ref_or_oid_value, path, line) orelse return error.RouteTooLong;│ │817 const prefix = if (loaded) "ai:" else "a:"; │ │818 return std.fmt.allocPrint(page_arena.allocator(), "{s}{s}", .{ prefix, try route.toUrl(page_arena) }); │ │819 } │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯