Commit 8c440cff authored by Simon Marlow's avatar Simon Marlow
Browse files

new commnad :abandon, discards the current computation (used to be :break stop)

parent c5f6a3c6
......@@ -102,6 +102,7 @@ builtin_commands = [
-- Hugs users are accustomed to :e, so make sure it doesn't overlap
("?", keepGoing help, False, completeNone),
("add", keepGoingPaths addModule, False, completeFilename),
("abandon", keepGoing abandonCmd, False, completeNone),
("break", keepGoing breakCmd, False, completeIdentifier),
("browse", keepGoing browseCmd, False, completeModule),
("cd", keepGoing changeDirectory, False, completeFilename),
......@@ -146,6 +147,7 @@ helpText =
"\n" ++
" <stmt> evaluate/run <stmt>\n" ++
" :add <filename> ... add module(s) to the current target set\n" ++
" :abandon at a breakpoint, abandon current computation\n" ++
" :break [<mod>] <l> [<col>] set a breakpoint at the specified location\n" ++
" :break <name> set a breakpoint on the specified function\n" ++
" :browse [*]<module> display the names defined by <module>\n" ++
......@@ -1383,6 +1385,16 @@ doContinue actionBeforeCont = do
finishEvalExpr names
return False
abandonCmd :: String -> GHCi ()
abandonCmd "" = do
mb_res <- popResume
case mb_res of
Nothing -> do
io $ putStrLn "There is no computation running."
Just (span,_,_) ->
return ()
-- the prompt will change to indicate the new context
deleteCmd :: String -> GHCi ()
deleteCmd argLine = do
deleteSwitch $ words argLine
......
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