From 7e63ccde7a9305b15b6e9e7675d278e5f9e18669 Mon Sep 17 00:00:00 2001 From: inv2004 <> Date: Tue, 19 Mar 2024 11:45:35 +0300 Subject: [PATCH] compatibility with nim 1.6.10 --- src/ttop/tui.nim | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/ttop/tui.nim b/src/ttop/tui.nim index 8f00c92..b4e2e4f 100644 --- a/src/ttop/tui.nim +++ b/src/ttop/tui.nim @@ -24,15 +24,15 @@ const HelpCol = fgGreen type Tui = ref object - sort = Cpu - scrollX = 0 - scrollY = 0 - filter = none(string) - threads = false - forceLive = false - draw = false - reload = false - quit = false + sort: SortField + scrollX: int + scrollY: int + filter: Option[string] + threads: bool + forceLive: bool + draw: bool + reload: bool + quit: bool hist: int blog: string refresh: bool @@ -492,7 +492,7 @@ iterator keyEachSec(): Key = if k == Key.None: timeout = 1000 else: - let b = (getMonoTime().ticks - a) div 1000000 + let b = int((getMonoTime().ticks - a) div 1000000) timeout = timeout - (b mod 1000) yield k @@ -506,7 +506,7 @@ proc tui*() = if getCfg().light: fgColor = fgLightColor - var tui = Tui() + var tui = Tui(sort: Cpu) (tui.blog, tui.hist) = moveBlog(0, tui.blog, tui.hist, 0) var live = newSeq[StatV2]() var (info, stats) = hist(tui.hist, tui.blog, live, tui.forceLive)