diff --git a/XMonad/Prompt.hs b/XMonad/Prompt.hs index 2c42a2eeb..4b1b3d682 100644 --- a/XMonad/Prompt.hs +++ b/XMonad/Prompt.hs @@ -185,7 +185,7 @@ data XPConfig = , historyFilter :: [String] -> [String] -- ^ a filter to determine which -- history entries to remember - , historyFetch :: FilePath -> IO History + , historyRead :: FilePath -> IO History -- ^ an IO function for fetching the command history , historyWrite :: FilePath -> History -> IO () -- ^ an IO function for writing the command history @@ -348,7 +348,7 @@ instance Default XPConfig where , maxComplColumns = Nothing , historySize = 256 , historyFilter = id - , historyFetch = readHistory + , historyRead = readHistory , historyWrite = writeHistory , defaultText = [] , autoComplete = Nothing @@ -569,7 +569,7 @@ mkXPromptImplementation historyKey conf om = do s <- gets $ screenRect . W.screenDetail . W.current . windowset cleanMask <- cleanKeyMask cachedir <- asks (cacheDir . directories) - hist <- io $ (historyFetch conf) cachedir + hist <- io $ historyRead conf cachedir fs <- initXMF (font conf) let width = getWinWidth s (position conf) st' <- io $ @@ -589,7 +589,7 @@ mkXPromptImplementation historyKey conf om = do releaseXMF fs when (successful st') $ do let prune = take (historySize conf) - io $ (historyWrite conf) cachedir $ + io $ historyWrite conf cachedir $ M.insertWith (\xs ys -> prune . historyFilter conf $ xs ++ ys) historyKey @@ -1810,7 +1810,7 @@ historyCompletionP p = do cd <- asks (cacheDir . directories) pure $ \x -> let toComplList = deleteConsecutive . filter (isInfixOf x) . M.foldr (++) [] --- in toComplList . M.filterWithKey (const . p) <$> (historyFetch conf) cd +-- in toComplList . M.filterWithKey (const . p) <$> (historyRead conf cd) in toComplList . M.filterWithKey (const . p) <$> (readHistory cd) -- | Sort a list and remove duplicates. Like 'deleteAllDuplicates', but trades off