summaryrefslogtreecommitdiff
path: root/Bustle.hs
diff options
context:
space:
mode:
authorWill Thompson <will@willthompson.co.uk>2011-08-08 15:36:09 +0200
committerWill Thompson <will@willthompson.co.uk>2011-08-08 15:50:24 +0200
commit56fed71634fb1a89ec30eb98c0f54b4a770dfb01 (patch)
tree1a5f381e9cfadb289e6483f87fccb8c46e306cd6 /Bustle.hs
parent92c35bd2976203a046915effc8ddd3ba306103cc (diff)
When filtering, preserve currently-selected event
Diffstat (limited to 'Bustle.hs')
-rw-r--r--Bustle.hs10
1 files changed, 7 insertions, 3 deletions
diff --git a/Bustle.hs b/Bustle.hs
index 5f2694d..665f1e5 100644
--- a/Bustle.hs
+++ b/Bustle.hs
@@ -398,9 +398,13 @@ updateDisplayedLog wi rr shapesRef widthRef regionSelectionRef = do
writeIORef shapesRef shapes
writeIORef widthRef width
- -- FIXME: try to preserve the currently-selected message?
- modifyRegionSelection regionSelectionRef wi $
- const (regionSelectionNew (rrRegions rr))
+ modifyRegionSelection regionSelectionRef wi $ \rs ->
+ let
+ rs' = regionSelectionNew (rrRegions rr)
+ in
+ case rsCurrent rs of
+ Just (_, x) -> regionSelectionSelect x rs'
+ Nothing -> rs'
layoutSetSize layout (floor width) (floor height)