╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ─╮ │src/ui.zig│ ╰──────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────╮ │509 } │ │510 if (std.mem.eql(u8, tab, files_seg)) { │ │511 params.scanPairs(&segments) catch return null; │ │506 - if (!params.only(ref_tab_keys)) return null; │ │507 - const start = params.start() orelse return null; │ │512 + if (!params.only(&.{ .line, .branch, .tag, .object })) return null; │ │513 + const line = params.line() orelse return null; │ │514 const dir = pathValue(segments.rest()) orelse return null; │ │515 const ref = (params.ref() catch return null) orelse │ │510 - return if (dir.len == 0) repoFilesRoute(pair, null, "", "", start) else null;│ │511 - return repoFilesRoute(pair, ref.kind, ref.value, dir, start); │ │516 + return if (dir.len == 0) repoFilesRoute(pair, null, "", "", line) else null; │ │517 + return repoFilesRoute(pair, ref.kind, ref.value, dir, line); │ │518 } │ │519 if (std.mem.eql(u8, tab, commits_seg)) { │ │520 params.scanPairs(&segments) catch return null; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────╮ │515 - if (!params.only(ref_tab_keys)) return null; │ │521 + if (!params.only(&.{ .start, .branch, .tag, .object })) return null;│ │522 const start = params.start() orelse return null; │ │523 const file = pathValue(segments.rest()) orelse return null; │ │524 const ref = (params.ref() catch return null) orelse │ ╰─────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │540 a_f.ref_kind == b.repo_files.ref_kind and │ │541 std.mem.eql(u8, a_f.ref_value.slice(), b.repo_files.ref_value.slice()) and │ │542 std.mem.eql(u8, a_f.path.slice(), b.repo_files.path.slice()) and │ │537 - a_f.start == b.repo_files.start, │ │543 + a_f.line == b.repo_files.line, │ │544 .repo_commits => |a_c| std.mem.eql(u8, a_c.name.slice(), b.repo_commits.name.slice()) and│ │545 a_c.ref_or_oid == b.repo_commits.ref_or_oid and │ │546 std.mem.eql(u8, a_c.value.slice(), b.repo_commits.value.slice()) and │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──────╮ │src/ui/Repo.zig│ ╰───────────────╯ ╭───────────────────────────────────────────────────────────────────────────────╮ │81 .repo_files => |f| f.path.slice(), │ │82 else => "", │ │83 }; │ │84 - const files_start = switch (route) { │ │85 - .repo_files => |f| f.start, │ │84 + const files_line = switch (route) { │ │85 + .repo_files => |f| f.line, │ │86 else => 0, │ │87 }; │ │88 // the hunk the commits view's selected commit's diff window starts at.│ ╰───────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │177 const is_local = session.local != null; │ │178 if (is_local) try evt.syncLocalEvents(repo_kind, opened.self_repo_opts, io, gpa, opened); │ │179 break :blk .{ │ │180 - try Files.init(repo_kind, opened.self_repo_opts, arena, opened, io, gpa, repo_identity.identity, requested_ref_or_oid, requested_ref_value, files_dir, files_start), │ │180 + try Files.init(repo_kind, opened.self_repo_opts, arena, opened, io, gpa, repo_identity.identity, requested_ref_or_oid, requested_ref_value, files_dir, files_line), │ │181 try Commits.init(repo_kind, opened.self_repo_opts, arena, opened, io, gpa, repo_identity.identity, requested_ref_or_oid, requested_ref_value, commits_start, commits_path),│ │182 try Refs.init(repo_kind, opened.self_repo_opts, arena, opened, io, gpa, repo_identity.identity, refs_kind, refs_from), │ │183 try Issues.init(repo_kind, opened.self_repo_opts, arena, opened, io, is_local, repo_identity.identity, issues_tag, issues_selected, issues_view), │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │203 const files_path = if (files.selected_file) |f| try Files.childDir(arena.allocator(), files.dir, f) else files.dir; │ │204 // the content window only applies to a selected file, so the bare │ │205 // directory route drops it. │ │206 - const files_route_start = if (files.selected_file != null) files_start else 0; │ │207 - const route_name = (ui.RoutablePage.repoFilesRoute(repo_identity.identity, files.ref_or_oid, files.ref_or_oid_value, files_path, files_route_start) orelse return error.NotFound).repo_files; │ │206 + const files_route_line = if (files.selected_file != null) files_line else 0; │ │207 + const route_name = (ui.RoutablePage.repoFilesRoute(repo_identity.identity, files.ref_or_oid, files.ref_or_oid_value, files_path, files_route_line) orelse return error.NotFound).repo_files; │ │208 const commits_route_name = (ui.RoutablePage.repoCommitsRoute(repo_identity.identity, commits.ref_or_oid, commits.ref_or_oid_value, commits_start, commits.path) orelse return error.NotFound).repo_commits;│ │209 │ │210 return .{ │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ────────────╮ │src/ui/Repo/Files.zig│ ╰─────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────╮ │14 const inp = @import("../input.zig"); │ │15 │ │16 // how many lines of a file's content one window shows before a "next" link. │ │17 -const file_page = 2000; │ │17 +const file_page = 5000; │ │18 │ │19 // how many files in a directory get their content preloaded (windowed) so │ │20 // selecting them shows contents without a reload. every entry is still listed;│ ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────╮ │33 // pane shows a placeholder rather than its bytes. │ │34 is_binary: bool = false, │ │35 // the line index this window starts at (0 = the first window). non-zero only│ │36 - // for the route's selected file, paginated by the url's `start`. │ │36 + // for the route's selected file, paginated by the url's `line`. │ │37 window_start: usize = 0, │ │38 // whether more lines exist after this window. │ │39 has_more: bool = false, │ ╰─────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────╮ │75 requested_ref_or_oid: ?ui.RoutablePage.RefOrOid,│ │76 requested_value: []const u8, │ │77 path: []const u8, │ │78 - start: usize, │ │78 + line: usize, │ │79 ) !Self { │ │80 const aa = arena.allocator(); │ │81 │ ╰────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │129 if (preloaded < max_preloaded or is_selected or isReadme(name)) { │ │130 preloaded += 1; │ │131 const file_path = try childDir(aa, dir, name); │ │132 - const window_start = if (is_selected) start else 0; │ │132 + // the url's `line` is 1-based (0 = unset); the window │ │133 + // index is 0-based. │ │134 + const window_start = if (is_selected) line -| 1 else 0; │ │135 const content = readFileContent(repo_kind, repo_opts, state, io, gpa, aa, file_path, tree_entry, window_start) catch│ │136 FileContent{ .lines = &.{} }; │ │137 entry.lines = content.lines; │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯