mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 11:30:22 -07:00
X.Prompt: get rid of MultiWayIf
Not needed anymore
This commit is contained in:
parent
344ace492b
commit
d7ad486a6e
@ -1,6 +1,5 @@
|
||||
{-# LANGUAGE ScopedTypeVariables #-}
|
||||
{-# LANGUAGE TupleSections #-}
|
||||
{-# LANGUAGE MultiWayIf #-}
|
||||
{-# LANGUAGE FlexibleContexts #-}
|
||||
{-# LANGUAGE ExistentialQuantification #-}
|
||||
{-# LANGUAGE CPP #-}
|
||||
@ -763,26 +762,26 @@ handleCompletion cs = do
|
||||
--
|
||||
--TODO: Scroll or paginate results
|
||||
hlComplete :: String -> [String] -> XPState -> XP ()
|
||||
hlComplete prevCompl l st =
|
||||
if | -- The current suggestion matches the command and is a
|
||||
hlComplete prevCompl l st
|
||||
| -- The current suggestion matches the command and is a
|
||||
-- proper suffix of the last suggestion, so replace it.
|
||||
isSuffixOfCmd && isProperSuffixOfLast -> replaceCompletion prevCompl
|
||||
isSuffixOfCmd && isProperSuffixOfLast = replaceCompletion prevCompl
|
||||
|
||||
| -- We only have one suggestion, so we need to be a little
|
||||
-- bit smart in order to avoid a loop.
|
||||
length cs == 1 ->
|
||||
length cs == 1 =
|
||||
if command st == hlCompl then put st else replaceCompletion (head cs)
|
||||
|
||||
-- The current suggestion matches the command, so advance
|
||||
-- to the next completion and try again.
|
||||
| isSuffixOfCmd ->
|
||||
| isSuffixOfCmd =
|
||||
hlComplete hlCompl l $ st{ complIndex = complIndex'
|
||||
, highlightedCompl = nextHlCompl
|
||||
}
|
||||
|
||||
-- If nothing matches at all, delete the suggestion and
|
||||
-- highlight the next one.
|
||||
| otherwise -> replaceCompletion prevCompl
|
||||
| otherwise = replaceCompletion prevCompl
|
||||
where
|
||||
hlCompl :: String = fromMaybe (command st) $ highlightedItem st l
|
||||
complIndex' :: (Int, Int) = nextComplIndex st (length l)
|
||||
|
Loading…
x
Reference in New Issue
Block a user