Ticket #9089: ghci_history_patch.diff

File ghci_history_patch.diff, 931 bytes (added by jcristovao, 10 months ago)

Patch to use local .ghci_history if available

Line 
1436,438d435
2< canonicalizePath' :: FilePath -> IO (Maybe FilePath)
3< canonicalizePath' fp = liftM Just (canonicalizePath fp)
4<                `catchIO` \_ -> return Nothing
5456a454,456
6>    canonicalizePath' :: FilePath -> IO (Maybe FilePath)
7>    canonicalizePath' fp = liftM Just (canonicalizePath fp)
8>                 `catchIO` \_ -> return Nothing
9536,537c536,537
10<     current_dir <- liftIO $ canonicalizePath' ".ghci_history"
11<     app_user_dir <- liftIO $ withGhcAppData (\dir -> return (Just (dir </> "ghci_history")))
12---
13>     histFile <- if gopt Opt_GhciHistory dflags
14>                 then liftIO $ withGhcAppData (\dir -> return (Just (dir </> "ghci_history")))
15539,544c539
16<     let ghciHistory = current_dir <|> app_user_dir
17<
18<
19<     histFile <- liftIO . return $ if gopt Opt_GhciHistory dflags
20<                     then ghciHistory
21<                     else Nothing
22---
23>                 else return Nothing