diff options
| author | Josh Rahm <rahm@google.com> | 2020-02-05 16:08:14 -0700 |
|---|---|---|
| committer | Josh Rahm <rahm@google.com> | 2020-02-05 16:08:14 -0700 |
| commit | 9169597a7dcef8046f415b77e0e6cbad696ff5a2 (patch) | |
| tree | f63afe549ea89c06b3fa42aef22b38c6a386648c /src/Internal/Layout.hs | |
| parent | c57a7f0db7dba41fd6851535845077adb08da18d (diff) | |
| download | rde-9169597a7dcef8046f415b77e0e6cbad696ff5a2.tar.gz rde-9169597a7dcef8046f415b77e0e6cbad696ff5a2.tar.bz2 rde-9169597a7dcef8046f415b77e0e6cbad696ff5a2.zip | |
Add ability to fuzzy find and jump to a window based on a prompt
Diffstat (limited to 'src/Internal/Layout.hs')
| -rw-r--r-- | src/Internal/Layout.hs | 6 |
1 files changed, 4 insertions, 2 deletions
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 |