X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fghci%2FInteractiveUI.hs;h=fbc53549b62e335a4a2f1aea2f434667f0138d75;hb=7510eeadaf490f7e7f6c9ab3f06ca500c1d95cc0;hp=c865943df3d90243ef0c64ae48e8a90f53648aef;hpb=575051778533f6ca7fea374eb3ccdcc18ef68908;p=ghc-hetmet.git diff --git a/compiler/ghci/InteractiveUI.hs b/compiler/ghci/InteractiveUI.hs index c865943..fbc5354 100644 --- a/compiler/ghci/InteractiveUI.hs +++ b/compiler/ghci/InteractiveUI.hs @@ -24,7 +24,7 @@ import PprTyThing import DynFlags import Packages -#ifdef USE_READLINE +#ifdef USE_EDITLINE import PackageConfig import UniqFM #endif @@ -56,9 +56,9 @@ import GHC.ConsoleHandler ( flushConsole ) 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 @@ -89,7 +89,7 @@ import GHC.TopHandler import Data.IORef ( IORef, readIORef, writeIORef ) -#ifdef USE_READLINE +#ifdef USE_EDITLINE import System.Posix.Internals ( setNonBlockingFD ) #endif @@ -161,7 +161,7 @@ builtin_commands = [ -- -- 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 = "(),;[]`{}" @@ -312,7 +312,7 @@ interactiveUI session srcs maybe_exprs = do -- 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 @@ -353,7 +353,7 @@ interactiveUI session srcs maybe_exprs = do remembered_ctx = [] } -#ifdef USE_READLINE +#ifdef USE_EDITLINE Readline.stifleHistory 100 withGhcAppData (\dir -> Readline.writeHistory (dir "ghci_history")) (return True) @@ -473,7 +473,7 @@ interactiveLoop is_tty show_prompt = -- 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) @@ -601,7 +601,7 @@ mkPrompt = do return (showSDoc (f (prompt st))) -#ifdef USE_READLINE +#ifdef USE_EDITLINE readlineLoop :: GHCi (Maybe String) readlineLoop = do io yield @@ -1659,7 +1659,7 @@ completeMacro, completeIdentifier, completeModule, 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