Skip to content

Commit 56c9bdd

Browse files
author
inv2004
committed
trim live graph to width
1 parent 4d46afb commit 56c9bdd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/ttop/tui.nim

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,8 @@ proc graphData(stats: seq[StatV2], sort: SortField, width: int): seq[float] =
165165
if result.len < width:
166166
let diff = width - stats.len
167167
result.insert(float(0).repeat(diff), 0)
168+
elif result.len > width:
169+
result = result[^width..^1]
168170

169171
proc graph(tui: Tui, tb: var TerminalBuffer, stats, live: seq[StatV2],
170172
blog: string) =

0 commit comments

Comments
 (0)