summaryrefslogtreecommitdiff
path: root/ghc
diff options
context:
space:
mode:
authorDenis M <Nolane16@gmail.com>2018-05-14 00:08:36 -0400
committerBen Gamari <ben@smart-cactus.org>2018-05-14 08:49:51 -0400
commite408d03b512f353067879ecdb5be4b6e48cf0431 (patch)
tree4f363ae230950eaec69f107f71d4c1b94bcf67be /ghc
parent6d57a92f60761f38c7f5cdefd5c35423a7fe1d10 (diff)
downloadhaskell-e408d03b512f353067879ecdb5be4b6e48cf0431.tar.gz
Fix #14973
Reviewers: bgamari Reviewed By: bgamari Subscribers: thomie, carter Differential Revision: https://phabricator.haskell.org/D4661
Diffstat (limited to 'ghc')
-rw-r--r--ghc/GHCi/UI.hs12
1 files changed, 4 insertions, 8 deletions
diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs
index 349368b6d7..3ed1c7f6a3 100644
--- a/ghc/GHCi/UI.hs
+++ b/ghc/GHCi/UI.hs
@@ -791,16 +791,14 @@ checkPromptStringForErrors (_:xs) = checkPromptStringForErrors xs
checkPromptStringForErrors "" = Nothing
generatePromptFunctionFromString :: String -> PromptFunction
-generatePromptFunctionFromString promptS = \_ _ -> do
- (context, modules_names, line) <- getInfoForPrompt
-
- let
+generatePromptFunctionFromString promptS modules_names line =
+ processString promptS
+ where
processString :: String -> GHCi SDoc
processString ('%':'s':xs) =
liftM2 (<>) (return modules_list) (processString xs)
where
- modules_list = context <> modules_bit
- modules_bit = hsep $ map text modules_names
+ modules_list = hsep $ map text modules_names
processString ('%':'l':xs) =
liftM2 (<>) (return $ ppr line) (processString xs)
processString ('%':'d':xs) =
@@ -861,8 +859,6 @@ generatePromptFunctionFromString promptS = \_ _ -> do
processString "" =
return empty
- processString promptS
-
mkPrompt :: GHCi String
mkPrompt = do
st <- getGHCiState