summaryrefslogtreecommitdiff
path: root/Omni
diff options
context:
space:
mode:
Diffstat (limited to 'Omni')
-rwxr-xr-xOmni/Bild.hs1
-rw-r--r--Omni/Log/Concurrent.hs20
2 files changed, 3 insertions, 18 deletions
diff --git a/Omni/Bild.hs b/Omni/Bild.hs
index 1bb42db..704a47d 100755
--- a/Omni/Bild.hs
+++ b/Omni/Bild.hs
@@ -542,6 +542,7 @@ analyze hmap ns = case Map.lookup ns hmap of
let quapath = path
user <- Env.getEnv "USER" /> Text.pack
host <- HostName.getHostName /> Text.pack
+ Log.wipe >> Log.info ["+", nschunk namespace]
contentLines <-
withFile abspath ReadMode <| \h ->
IO.hSetEncoding h IO.utf8_bom
diff --git a/Omni/Log/Concurrent.hs b/Omni/Log/Concurrent.hs
index 391fcff..204e497 100644
--- a/Omni/Log/Concurrent.hs
+++ b/Omni/Log/Concurrent.hs
@@ -89,11 +89,7 @@ withLineManager maxLines action = do
result <- action mgr
- forM_ [0 .. maxLines - 1] <| \_ -> do
- ANSI.hCursorDown IO.stderr 1
- ANSI.hSetCursorColumn IO.stderr 0
- ANSI.hClearLine IO.stderr
-
+ ANSI.hCursorDown IO.stderr maxLines
writeIORef currentLineManager Nothing
writeIORef namespaceLines Map.empty
pure result
@@ -122,19 +118,7 @@ reserveLine LineManager {..} ns =
linesMap' = Map.insert lineNum (Just status) linesMap
in (linesMap', Just lineNum)
case mLine of
- Just lineNum -> do
- modifyIORef' namespaceLines (Map.insert ns lineNum)
- currentLine <- readIORef lmCurrentLine
- ANSI.hSaveCursor IO.stderr
- ANSI.hSetCursorColumn IO.stderr 0
- let linesToMove = currentLine - lineNum
- when (linesToMove > 0) <| ANSI.hCursorUp IO.stderr linesToMove
- when (linesToMove < 0) <| ANSI.hCursorDown IO.stderr (abs linesToMove)
- ANSI.hClearLine IO.stderr
- let nsText = Text.pack (Namespace.toPath ns)
- IO.hPutStr IO.stderr (Text.unpack <| "[+] " <> nsText)
- IO.hFlush IO.stderr
- ANSI.hRestoreCursor IO.stderr
+ Just lineNum -> modifyIORef' namespaceLines (Map.insert ns lineNum)
Nothing -> pure ()
pure mLine
where