diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs
index c92392d..81592c4 100644
|
a
|
b
|
|
| 126 | 126 | ("def", keepGoing (defineMacro False), completeExpression), |
| 127 | 127 | ("def!", keepGoing (defineMacro True), completeExpression), |
| 128 | 128 | ("delete", keepGoing deleteCmd, noCompletion), |
| 129 | | ("edit", keepGoing editFile, completeFilename), |
| | 129 | ("edit", keepGoing' editFile, completeFilename), |
| 130 | 130 | ("etags", keepGoing createETagsFileCmd, completeFilename), |
| 131 | 131 | ("force", keepGoing forceCmd, completeExpression), |
| 132 | 132 | ("forward", keepGoing forwardCmd, noCompletion), |
| … |
… |
|
| 1044 | 1044 | ----------------------------------------------------------------------------- |
| 1045 | 1045 | -- :edit |
| 1046 | 1046 | |
| 1047 | | editFile :: String -> GHCi () |
| | 1047 | editFile :: String -> InputT GHCi () |
| 1048 | 1048 | editFile str = |
| 1049 | | do file <- if null str then chooseEditFile else return str |
| 1050 | | st <- getGHCiState |
| | 1049 | do file <- if null str then lift chooseEditFile else return str |
| | 1050 | st <- lift getGHCiState |
| 1051 | 1051 | let cmd = editor st |
| 1052 | 1052 | when (null cmd) |
| 1053 | 1053 | $ ghcError (CmdLineError "editor not set, use :set editor") |
| 1054 | | _ <- liftIO $ system (cmd ++ ' ':file) |
| 1055 | | return () |
| | 1054 | code <- liftIO $ system (cmd ++ ' ':file) |
| | 1055 | when (code == ExitSuccess) |
| | 1056 | $ reloadModule "" |
| 1056 | 1057 | |
| 1057 | 1058 | -- The user didn't specify a file so we pick one for them. |
| 1058 | 1059 | -- Our strategy is to pick the first module that failed to load, |