From f6119822059af4f50a4c19aaeca98c68d8fda6ff Mon Sep 17 00:00:00 2001 From: Andrea Rossato Date: Sat, 16 Feb 2008 13:37:38 +0000 Subject: [PATCH] Theme: move theme's nextCompletion implementation to Prompt.getNextCompletion --- XMonad/Prompt/Theme.hs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/XMonad/Prompt/Theme.hs b/XMonad/Prompt/Theme.hs index cf67a36e..89063a5a 100644 --- a/XMonad/Prompt/Theme.hs +++ b/XMonad/Prompt/Theme.hs @@ -45,10 +45,7 @@ data ThemePrompt = ThemePrompt instance XPrompt ThemePrompt where showXPrompt ThemePrompt = "Select a theme: " commandToComplete _ c = c - nextCompletion _ c l = l !! idx - where idx = case c `elemIndex` l of - Just i -> if i >= length l - 1 then 0 else i + 1 - Nothing -> 0 + nextCompletion _ = getNextCompletion themePrompt :: XPConfig -> X () themePrompt c = mkXPrompt ThemePrompt c (const . return . map ppThemeInfo $ listOfThemes) changeTheme