don't display console regions untill there is output in them
This commit is contained in:
parent
5e2ea9c1a5
commit
17b173dec9
1 changed files with 10 additions and 2 deletions
|
@ -43,7 +43,12 @@ concurrentMessage iserror msg _ = go =<< consoleRegion <$> Annex.getState Annex.
|
||||||
when iserror $ do
|
when iserror $ do
|
||||||
Annex.changeState $ \s ->
|
Annex.changeState $ \s ->
|
||||||
s { Annex.output = (Annex.output s) { consoleRegionErrFlag = True } }
|
s { Annex.output = (Annex.output s) { consoleRegionErrFlag = True } }
|
||||||
liftIO $ Regions.appendConsoleRegion r msg
|
liftIO $ atomically $ do
|
||||||
|
Regions.appendConsoleRegion r msg
|
||||||
|
rl <- takeTMVar Regions.regionList
|
||||||
|
putTMVar Regions.regionList
|
||||||
|
(if r `elem` rl then rl else r:rl)
|
||||||
|
|
||||||
#else
|
#else
|
||||||
concurrentMessage _ _ fallback = fallback
|
concurrentMessage _ _ fallback = fallback
|
||||||
#endif
|
#endif
|
||||||
|
@ -73,7 +78,10 @@ inOwnConsoleRegion a = do
|
||||||
rmregion r
|
rmregion r
|
||||||
return ret
|
return ret
|
||||||
where
|
where
|
||||||
mkregion = Regions.openConsoleRegion Regions.Linear
|
-- The region is allocated here, but not displayed until
|
||||||
|
-- a message is added to it. This avoids unnecessary screen
|
||||||
|
-- updates when a region does not turn out to need to be used.
|
||||||
|
mkregion = Regions.newConsoleRegion Regions.Linear ""
|
||||||
setregion r = Annex.changeState $ \s -> s { Annex.output = (Annex.output s) { consoleRegion = r } }
|
setregion r = Annex.changeState $ \s -> s { Annex.output = (Annex.output s) { consoleRegion = r } }
|
||||||
rmregion r = do
|
rmregion r = do
|
||||||
errflag <- consoleRegionErrFlag <$> Annex.getState Annex.output
|
errflag <- consoleRegionErrFlag <$> Annex.getState Annex.output
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue