From 9169597a7dcef8046f415b77e0e6cbad696ff5a2 Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Wed, 5 Feb 2020 16:08:14 -0700 Subject: Add ability to fuzzy find and jump to a window based on a prompt --- src/Internal/Layout.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/Internal/Layout.hs') diff --git a/src/Internal/Layout.hs b/src/Internal/Layout.hs index 4cfe3d3..08aaa7a 100644 --- a/src/Internal/Layout.hs +++ b/src/Internal/Layout.hs @@ -40,7 +40,7 @@ instance (Show a) => LayoutClass Center a where nWin = length (W.integrate stack) winsTop = nWin `div` 8 - portion = fromIntegral $ nWin `div` 6 + portion = fromIntegral $ (guard 1 (nWin `div` 6)) winRem = fromIntegral $ nWin `mod` 6 in do let ret = @@ -50,9 +50,11 @@ instance (Show a) => LayoutClass Center a where ++ (divRect rightRect portion) ++ (divRect bottomRect (portion * 2)) ++ (divRect leftRect (portion + winRem))), Just l) - liftIO $ writeFile "/tmp/wtf.txt" (description l ++ ": " ++ show (fst ret)) return ret where + guard n 0 = n + guard _ n = n + divRect (Rectangle x y w h) n = if h > w then -- cgit