summaryrefslogtreecommitdiff
path: root/main/Main.hs
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2024-07-17 21:20:48 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2024-07-17 21:20:48 +0200
commit4684006e4dd4c42674ba17a35ba394c939674346 (patch)
tree2fcc45f7c4ecb8fdcd31bbfd21fe3fda75f8cb19 /main/Main.hs
parent79655a00f7d7a95d9954947df50a8b772af8e703 (diff)
Evaluate external print parameter first to avoid blinking
Diffstat (limited to 'main/Main.hs')
-rw-r--r--main/Main.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/main/Main.hs b/main/Main.hs
index d5b06ea..236e729 100644
--- a/main/Main.hs
+++ b/main/Main.hs
@@ -231,8 +231,10 @@ interactiveLoop st opts = runInputT inputSettings $ do
tui <- haveTerminalUI
extPrint <- getExternalPrint
- let extPrintLn str = extPrint $ case reverse str of ('\n':_) -> str
- _ -> str ++ "\n";
+ let extPrintLn str = do
+ let str' = case reverse str of ('\n':_) -> str
+ _ -> str ++ "\n";
+ extPrint $! str' -- evaluate str before calling extPrint to avoid blinking
let getInputLinesTui eprompt = do
prompt <- case eprompt of