diff options
Diffstat (limited to 'Omni')
| -rw-r--r-- | Omni/Log/Concurrent.hs | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/Omni/Log/Concurrent.hs b/Omni/Log/Concurrent.hs index d7723e5..4654365 100644 --- a/Omni/Log/Concurrent.hs +++ b/Omni/Log/Concurrent.hs @@ -91,7 +91,7 @@ initializeLines LineManager {..} = forM_ (Map.toList nsMap) <| \(ns, lineNum) -> do ANSI.hSaveCursor IO.stderr ANSI.hSetCursorColumn IO.stderr 0 - ANSI.hCursorUp IO.stderr (length lmNamespaces - lineNum) + when (lineNum > 0) <| ANSI.hCursorDown IO.stderr lineNum ANSI.hClearLine IO.stderr let nsText = Text.pack (Namespace.toPath ns) IO.hPutStr IO.stderr (Text.unpack <| "[…] " <> nsText) @@ -117,10 +117,7 @@ updateLine ns output = do Just lineNum -> do ANSI.hSaveCursor IO.stderr ANSI.hSetCursorColumn IO.stderr 0 - let currentLine = length lmNamespaces - let linesToMove = currentLine - lineNum - when (linesToMove > 0) <| ANSI.hCursorUp IO.stderr linesToMove - when (linesToMove < 0) <| ANSI.hCursorDown IO.stderr (abs linesToMove) + ANSI.hCursorUp IO.stderr (length lmNamespaces - lineNum) ANSI.hClearLine IO.stderr let nsText = Text.pack (Namespace.toPath ns) let formattedOutput = if Text.null output then "[~] " <> nsText else "[~] " <> nsText <> ": " <> output @@ -141,10 +138,7 @@ updateLineState ns buildState = do Just lineNum -> do ANSI.hSaveCursor IO.stderr ANSI.hSetCursorColumn IO.stderr 0 - let currentLine = length lmNamespaces - let linesToMove = currentLine - lineNum - when (linesToMove > 0) <| ANSI.hCursorUp IO.stderr linesToMove - when (linesToMove < 0) <| ANSI.hCursorDown IO.stderr (abs linesToMove) + ANSI.hCursorUp IO.stderr (length lmNamespaces - lineNum) ANSI.hClearLine IO.stderr let nsText = Text.pack (Namespace.toPath ns) case buildState of |
