mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-08-06 06:51:55 -07:00
Theme: move theme's nextCompletion implementation to Prompt.getNextCompletion
This commit is contained in:
@@ -45,10 +45,7 @@ data ThemePrompt = ThemePrompt
|
|||||||
instance XPrompt ThemePrompt where
|
instance XPrompt ThemePrompt where
|
||||||
showXPrompt ThemePrompt = "Select a theme: "
|
showXPrompt ThemePrompt = "Select a theme: "
|
||||||
commandToComplete _ c = c
|
commandToComplete _ c = c
|
||||||
nextCompletion _ c l = l !! idx
|
nextCompletion _ = getNextCompletion
|
||||||
where idx = case c `elemIndex` l of
|
|
||||||
Just i -> if i >= length l - 1 then 0 else i + 1
|
|
||||||
Nothing -> 0
|
|
||||||
|
|
||||||
themePrompt :: XPConfig -> X ()
|
themePrompt :: XPConfig -> X ()
|
||||||
themePrompt c = mkXPrompt ThemePrompt c (const . return . map ppThemeInfo $ listOfThemes) changeTheme
|
themePrompt c = mkXPrompt ThemePrompt c (const . return . map ppThemeInfo $ listOfThemes) changeTheme
|
||||||
|
Reference in New Issue
Block a user