reverse sorting on quote tab to match history tab

This commit is contained in:
Emil Lerch 2026-07-06 12:47:57 -07:00
parent 550fa4fd88
commit 473a94976d
Signed by: lobo
GPG key ID: A7B62D657EF764F8

View file

@ -875,8 +875,10 @@ fn buildStyledLines(app: *App, arena: std.mem.Allocator) ![]const StyledLine {
try lines.append(arena, .{ .text = " Recent History:", .style = th.headerStyle() });
try lines.append(arena, .{ .text = try std.fmt.allocPrint(arena, " {s:>12} {s:>10} {s:>10} {s:>10} {s:>10} {s:>12}", .{ "Date", "Open", "High", "Low", "Close", "Volume" }), .style = th.mutedStyle() });
const start_idx = if (c.len > 20) c.len - 20 else 0;
for (c[start_idx..]) |candle| {
const end_idx = if (c.len > 20) c.len - 20 else 0;
var curr = c.len - 1;
while (curr >= end_idx) : (curr -= 1) {
const candle = c[curr];
var row_buf: [128]u8 = undefined;
const day_change = if (candle.close >= candle.open) th.positiveStyle() else th.negativeStyle();
try lines.append(arena, .{ .text = try arena.dupe(u8, fmt.fmtCandleRow(&row_buf, candle)), .style = day_change });