mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 03:20:21 -07:00
ShellPrompt: quickcheck related refactoring
This commit is contained in:
parent
6febbc8131
commit
3b89f02650
@ -16,6 +16,8 @@ module XMonadContrib.ShellPrompt (
|
|||||||
-- * Usage
|
-- * Usage
|
||||||
-- $usage
|
-- $usage
|
||||||
shellPrompt
|
shellPrompt
|
||||||
|
, rmPath
|
||||||
|
, split
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import XMonad
|
import XMonad
|
||||||
@ -73,8 +75,10 @@ commandCompletionFunction str
|
|||||||
cl = liftM (nub . rmPath . concat) . mapM fCF . map addToPath . split ':'
|
cl = liftM (nub . rmPath . concat) . mapM fCF . map addToPath . split ':'
|
||||||
addToPath = flip (++) ("/" ++ str)
|
addToPath = flip (++) ("/" ++ str)
|
||||||
fCF = filenameCompletionFunction
|
fCF = filenameCompletionFunction
|
||||||
rmPath [] = []
|
|
||||||
rmPath s = map (last . split '/') s
|
rmPath :: [String] -> [String]
|
||||||
|
rmPath s =
|
||||||
|
map (reverse . fst . break (=='/') . reverse) s
|
||||||
|
|
||||||
split :: Eq a => a -> [a] -> [[a]]
|
split :: Eq a => a -> [a] -> [[a]]
|
||||||
split _ [] = []
|
split _ [] = []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user