mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-07-26 09:41:52 -07:00
Merge pull request #134 from pjones/bugfix/prompt-history
Use the new getXMonadCacheDir function from #62
This commit is contained in:
@@ -11,6 +11,9 @@
|
|||||||
* New constructor `CenteredAt Rational Rational` added for
|
* New constructor `CenteredAt Rational Rational` added for
|
||||||
`XMonad.Prompt.XPPosition`.
|
`XMonad.Prompt.XPPosition`.
|
||||||
|
|
||||||
|
* `XMonad.Prompt` now stores its history file in the XMonad cache
|
||||||
|
directory in a file named `prompt-history`.
|
||||||
|
|
||||||
### New Modules
|
### New Modules
|
||||||
|
|
||||||
* `XMonad.Layout.SortedLayout`
|
* `XMonad.Layout.SortedLayout`
|
||||||
|
@@ -91,7 +91,6 @@ import Data.List
|
|||||||
import qualified Data.Map as M
|
import qualified Data.Map as M
|
||||||
import Data.Maybe (fromMaybe)
|
import Data.Maybe (fromMaybe)
|
||||||
import Data.Set (fromList, toList)
|
import Data.Set (fromList, toList)
|
||||||
import System.Directory (getAppUserDataDirectory)
|
|
||||||
import System.IO
|
import System.IO
|
||||||
import System.Posix.Files
|
import System.Posix.Files
|
||||||
|
|
||||||
@@ -1064,7 +1063,7 @@ emptyHistory :: History
|
|||||||
emptyHistory = M.empty
|
emptyHistory = M.empty
|
||||||
|
|
||||||
getHistoryFile :: IO FilePath
|
getHistoryFile :: IO FilePath
|
||||||
getHistoryFile = fmap (++ "/history") $ getAppUserDataDirectory "xmonad"
|
getHistoryFile = fmap (++ "/prompt-history") getXMonadCacheDir
|
||||||
|
|
||||||
readHistory :: IO History
|
readHistory :: IO History
|
||||||
readHistory = readHist `E.catch` \(SomeException _) -> return emptyHistory
|
readHistory = readHist `E.catch` \(SomeException _) -> return emptyHistory
|
||||||
@@ -1170,7 +1169,7 @@ breakAtSpace s
|
|||||||
|
|
||||||
-- | 'historyCompletion' provides a canned completion function much like
|
-- | 'historyCompletion' provides a canned completion function much like
|
||||||
-- 'getShellCompl'; you pass it to mkXPrompt, and it will make completions work
|
-- 'getShellCompl'; you pass it to mkXPrompt, and it will make completions work
|
||||||
-- from the query history stored in ~\/.xmonad\/history.
|
-- from the query history stored in the XMonad cache directory.
|
||||||
historyCompletion :: ComplFunction
|
historyCompletion :: ComplFunction
|
||||||
historyCompletion = historyCompletionP (const True)
|
historyCompletion = historyCompletionP (const True)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user