reverse sorting on quote tab to match history tab
This commit is contained in:
parent
550fa4fd88
commit
473a94976d
1 changed files with 4 additions and 2 deletions
|
|
@ -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 });
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue