Commit e408d03b authored by Nolan's avatar Nolan Committed by Ben Gamari

Fix #14973

Reviewers: bgamari

Reviewed By: bgamari

Subscribers: thomie, carter

Differential Revision: https://phabricator.haskell.org/D4661
parent 6d57a92f
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment