aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrea Rossato <andrea.rossato@unibz.it>2007-08-22 21:32:20 +0200
committerAndrea Rossato <andrea.rossato@unibz.it>2007-08-22 21:32:20 +0200
commit2e141204a708829e98a26b840491cafd64ce6779 (patch)
tree70cebe9b904547b330ca49f7ad9c7a8d428e7815
parenta6212291c0b54907b98e8f9b3e535aa14062fd3a (diff)
downloadXMonadContrib-2e141204a708829e98a26b840491cafd64ce6779.tar.gz
XMonadContrib-2e141204a708829e98a26b840491cafd64ce6779.tar.xz
XMonadContrib-2e141204a708829e98a26b840491cafd64ce6779.zip
XPrompt: just code formatting
darcs-hash:20070822193220-32816-528777cc85fa4f58dd483d8e9a1b4d19c7d85f16.gz
-rw-r--r--XPrompt.hs52
1 files changed, 26 insertions, 26 deletions
diff --git a/XPrompt.hs b/XPrompt.hs
index ecd0022..79605ba 100644
--- a/XPrompt.hs
+++ b/XPrompt.hs
@@ -69,20 +69,20 @@ import System.Posix.Files
type XP = StateT XPState IO
data XPState =
- XPS { dpy :: Display
- , rootw :: Window
- , win :: Window
- , screen :: Rectangle
- , complWin :: Maybe Window
- , complWinDim :: Maybe ComplWindowDim
+ XPS { dpy :: Display
+ , rootw :: Window
+ , win :: Window
+ , screen :: Rectangle
+ , complWin :: Maybe Window
+ , complWinDim :: Maybe ComplWindowDim
, completionFunction :: String -> IO [String]
- , gcon :: GC
- , fs :: FontStruct
- , xptype :: XPType
- , command :: String
- , offset :: Int
- , history :: [History]
- , config :: XPConfig
+ , gcon :: GC
+ , fs :: FontStruct
+ , xptype :: XPType
+ , command :: String
+ , offset :: Int
+ , history :: [History]
+ , config :: XPConfig
}
data XPConfig =
@@ -125,15 +125,15 @@ data XPPosition = Top
defaultXPConfig :: XPConfig
defaultXPConfig =
- XPC { font = "-misc-fixed-*-*-*-*-10-*-*-*-*-*-*-*"
- , bgColor = "#333333"
- , fgColor = "#FFFFFF"
- , fgHLight = "#000000"
- , bgHLight = "#BBBBBB"
+ XPC { font = "-misc-fixed-*-*-*-*-10-*-*-*-*-*-*-*"
+ , bgColor = "#333333"
+ , fgColor = "#FFFFFF"
+ , fgHLight = "#000000"
+ , bgHLight = "#BBBBBB"
, borderColor = "#FFFFFF"
, borderWidth = 1
- , position = Bottom
- , height = 18
+ , position = Bottom
+ , height = 18
, historySize = 256
}
@@ -177,7 +177,7 @@ mkXPrompt t conf compl action = do
liftIO $ hClose h
when (command st' /= "") $ do
let htw = take (historySize conf) (history st')
- liftIO $ writeHistory h htw
+ liftIO $ writeHistory htw
action (command st')
runXP :: XP ()
@@ -339,8 +339,8 @@ deleteString d =
where o oo = if d == Prev then max 0 (oo - 1) else oo
c oc oo
| oo >= length oc && d == Prev = take (oo - 1) oc
- | oo < length oc && d == Prev = take (oo - 1) f ++ ss
- | oo < length oc && d == Next = f ++ tail ss
+ | oo < length oc && d == Prev = take (oo - 1) f ++ ss
+ | oo < length oc && d == Next = f ++ tail ss
| otherwise = oc
where (f,ss) = splitAt oo oc
@@ -516,7 +516,7 @@ drawComplWin w compl = do
gc = gcon st
bgcolor <- io $ initColor d (bgColor c)
fgcolor <- io $ initColor d (fgColor c)
- border <- io $ initColor d (borderColor c)
+ border <- io $ initColor d (borderColor c)
(_,_,wh,ht,xx,yy) <- getComplWinDim compl
@@ -603,8 +603,8 @@ readHistory = do
else do h <- openFile path WriteMode
return ([],h)
-writeHistory :: Handle -> [History] -> IO ()
-writeHistory _ hist = do
+writeHistory :: [History] -> IO ()
+writeHistory hist = do
home <- getEnv "HOME"
let path = home ++ "/.xmonad_history"
catch (writeFile path (show hist)) (\_ -> do putStrLn "error in writing"; return ())