From 0b25bd8112e32a67b407cee7756c336a53b0eaed Mon Sep 17 00:00:00 2001 From: inv2004 <> Date: Mon, 23 Jan 2023 16:32:31 +0300 Subject: [PATCH] fix header line --- src/ttop/tui.nim | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ttop/tui.nim b/src/ttop/tui.nim index 1922a41..f4a9d04 100644 --- a/src/ttop/tui.nim +++ b/src/ttop/tui.nim @@ -49,15 +49,15 @@ proc header(tb: var TerminalBuffer, info: FullInfoRef, hist, cnt: int, info.sys.datetime.format( "yyyy-MM-dd HH:mm:ss") if hist > 0: - tb.write fmt" {blog}: {hist} / {cnt}" + tb.write fmt" {blog}: {hist} / {cnt} " elif blog == "": - tb.write fmt" autoupdate log: empty" + tb.write fmt" autoupdate log: empty " else: - tb.write fmt" autoupdate {blog}: {cnt}" - let x = tb.getCursorYPos() - if tb.width - 71 > 0: - tb.write ' '.repeat(tb.width-71) - tb.setCursorXPos x + tb.write fmt" autoupdate {blog}: {cnt} " + let curX = tb.getCursorXPos() + if tb.width - curX - 2 > 0: + tb.write ' '.repeat(tb.width - curX - 2) + tb.setCursorXPos curX let procStr = fmt"PROCS: {$info.pidsInfo.len}" tb.writeR procStr tb.setCursorPos(offset, 2)