Shellac-editline 0.9 → 0.9.5
raw patch · 2 files changed
+26/−4 lines, 2 filesdep ~editline
Dependency ranges changed: editline
Files
Shellac-editline.cabal view
@@ -1,5 +1,5 @@ Name: Shellac-editline-Version: 0.9+Version: 0.9.5 Cabal-version: >= 1.2 Build-type: Simple Author: Robert Dockins@@ -21,7 +21,7 @@ src Build-Depends: base, haskell98,- editline >= 0.2,+ editline >= 0.2.1, Shellac >= 0.9 Exposed-modules: System.Console.Shell.Backend.Editline
src/System/Console/Shell/Backend/Editline.hs view
@@ -19,6 +19,7 @@ , hSetBuffering, hGetBuffering , BufferMode(..) )+import System.IO.Error ( mkIOError, userErrorType ) import qualified Control.Exception as Ex import System.Console.Editline@@ -45,8 +46,8 @@ , clearHistoryState = \_ -> EL.clearHistory , setMaxHistoryEntries = \_ -> EL.stifleHistory , getMaxHistoryEntries = \_ -> EL.historyMaxEntries- , readHistory = \_ -> EL.readHistory- , writeHistory = \_ -> EL.writeHistory+ , readHistory = \_ -> editlineReadHistory+ , writeHistory = \_ -> editlineWriteHistory } @@ -75,3 +76,24 @@ editlineOutput (RegularOutput str) = hPutStr stdout str editlineOutput (InfoOutput str) = hPutStr stdout str editlineOutput (ErrorOutput str) = hPutStr stderr str+++editlineReadHistory :: FilePath -> IO ()+editlineReadHistory p = do+ x <- EL.readHistory p+ if x then return ()+ else ioError $ mkIOError+ userErrorType+ "System.Console.Shell.Backend.Editline.editlineReadHistory"+ Nothing+ (Just p)++editlineWriteHistory :: FilePath -> IO ()+editlineWriteHistory p = do+ x <- EL.writeHistory p+ if x then return ()+ else ioError $ mkIOError+ userErrorType+ "System.Console.Shell.Backend.Editline.editlineWriteHistory"+ Nothing+ (Just p)