import DynFlags
import Packages
-#ifdef USE_READLINE
+#ifdef USE_EDITLINE
import PackageConfig
import UniqFM
#endif
import qualified System.Win32
#endif
-#ifdef USE_READLINE
+#ifdef USE_EDITLINE
import Control.Concurrent ( yield ) -- Used in readline loop
-import System.Console.Readline as Readline
+import System.Console.Editline.Readline as Readline
#endif
--import SystemExts
import Data.IORef ( IORef, readIORef, writeIORef )
-#ifdef USE_READLINE
+#ifdef USE_EDITLINE
import System.Posix.Internals ( setNonBlockingFD )
#endif
--
-- NOTE: in order for us to override the default correctly, any custom entry
-- must be a SUBSET of word_break_chars.
-#ifdef USE_READLINE
+#ifdef USE_EDITLINE
word_break_chars :: String
word_break_chars = let symbols = "!#$%&*+/<=>?@\\^|-~"
specials = "(),;[]`{}"
-- intended for the program, so unbuffer stdin.
hSetBuffering stdin NoBuffering
-#ifdef USE_READLINE
+#ifdef USE_EDITLINE
is_tty <- hIsTerminalDevice stdin
when is_tty $ do
Readline.initialize
remembered_ctx = []
}
-#ifdef USE_READLINE
+#ifdef USE_EDITLINE
Readline.stifleHistory 100
withGhcAppData (\dir -> Readline.writeHistory (dir </> "ghci_history"))
(return True)
-- exception handler above.
-- read commands from stdin
-#ifdef USE_READLINE
+#ifdef USE_EDITLINE
if (is_tty)
then runCommands readlineLoop
else runCommands (fileLoop stdin show_prompt is_tty)
return (showSDoc (f (prompt st)))
-#ifdef USE_READLINE
+#ifdef USE_EDITLINE
readlineLoop :: GHCi (Maybe String)
readlineLoop = do
io yield
completeHomeModuleOrFile
:: String -> IO [String]
-#ifdef USE_READLINE
+#ifdef USE_EDITLINE
completeWord :: String -> Int -> Int -> IO (Maybe (String, [String]))
completeWord w start end = do
line <- Readline.getLineBuffer
breakSwitch _session [] = do
io $ putStrLn "The break command requires at least one argument."
breakSwitch session (arg1:rest)
- | looksLikeModuleName arg1 = do
+ | looksLikeModuleName arg1 && not (null rest) = do
mod <- wantInterpretedModule arg1
breakByModule mod rest
| all isDigit arg1 = do