From 21b7f6a72457a0271ea58e159d045da0ca53f624 Mon Sep 17 00:00:00 2001 From: Ilya Portnov Date: Mon, 16 May 2011 00:12:21 +0600 Subject: [PATCH] Update searchGS. --- lib/Themes.hs | 19 ++++++++++++++++++- 1 files changed, 18 insertions(+), 1 deletions(-) diff --git a/lib/Themes.hs b/lib/Themes.hs index 47c50f1..28cdc5b 100644 --- a/lib/Themes.hs +++ b/lib/Themes.hs @@ -22,9 +22,26 @@ myGSConfig = defaultGSConfig { searchGS :: HasColorizer a => GSConfig a searchGS = defaultGSConfig { - gs_navigate = navNSearch, + gs_navigate = search, gs_font = myFont } +search :: TwoD a (Maybe a) +search = makeXEventhandler $ shadowWithKeymap navNSearchKeyMap navNSearchDefaultHandler + where navNSearchKeyMap = M.fromList [ + ((0,xK_Escape), cancel) + ,((0,xK_Return), select) + ,((0,xK_Left) , move (-1,0) >> search) + ,((0,xK_Right) , move (1,0) >> search) + ,((0,xK_Down) , move (0,1) >> search) + ,((0,xK_Up) , move (0,-1) >> search) + ,((0,xK_Tab) , moveNext >> search) + ,((shiftMask,xK_Tab), movePrev >> search) + ,((0,xK_BackSpace), transformSearchString (\s -> if (s == "") then "" else init s) >> search) + ] + -- The navigation handler ignores unknown key symbols, therefore we const + navNSearchDefaultHandler (_,s,_) = do + transformSearchString (++ s) + search ----------------------------------------------------------------------- -- Some general settings myWorkspaces :: [WorkspaceId] -- 1.7.2.3