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
|
||||
shellPrompt
|
||||
, rmPath
|
||||
, split
|
||||
) where
|
||||
|
||||
import XMonad
|
||||
@ -73,8 +75,10 @@ commandCompletionFunction str
|
||||
cl = liftM (nub . rmPath . concat) . mapM fCF . map addToPath . split ':'
|
||||
addToPath = flip (++) ("/" ++ str)
|
||||
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 _ [] = []
|
||||
|
Loading…
x
Reference in New Issue
Block a user