╭ changed ─╮ │src/ui.zig│ ╰──────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │39 } │ │40 const clipped = iter.nextCodepointSlice() != null; │ │41 return try std.fmt.bufPrint(buffer, "{s}{s}", .{ text[0..if (clipped) clipped_end else end], if (clipped) ".." else "" });│ │42 +} │ │43 + │ │44 +pub const detail_preview_lines = 50; │ │45 + │ │46 +pub fn detailPreviewEnd(text: []const u8) ?usize { │ │47 + var lines: usize = 1; │ │48 + for (text, 0..) |byte, i| { │ │49 + if (byte != '\n') continue; │ │50 + if (lines == detail_preview_lines and i + 1 < text.len) return i; │ │51 + lines += 1; │ │52 + } │ │53 + return null; │ │54 } │ │55 │ │56 pub const PageKind = enum { │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯