From 7bd78669931deb20b10befda32a85ae4926873a5 Mon Sep 17 00:00:00 2001 From: Paul Chiusano Date: Fri, 6 Nov 2015 09:38:36 -0500 Subject: [PATCH] Added enter close events --- editor/src/Unison/Explorer.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/editor/src/Unison/Explorer.hs b/editor/src/Unison/Explorer.hs index 4563cd93d..68621fc73 100644 --- a/editor/src/Unison/Explorer.hs +++ b/editor/src/Unison/Explorer.hs @@ -88,8 +88,10 @@ explorer keydown processQuery topContent s0 = do keyClosings <- pure $ let f a = case a of Cancel -> Just Nothing; Accept a -> Just (Just a); _ -> Nothing in fmapMaybe f actions - let mouseClosings = pushAlways (\_ -> sample (current selection)) $ domEvent Click selectableRegion - pure (updated valids, s', leftmost [keyClosings, mouseClosings]) + let sampleCurrent _ = sample (current selection) + let mouseClosings = pushAlways sampleCurrent $ domEvent Click selectableRegion + let enterClosings = pushAlways sampleCurrent $ textInputGetEnter searchbox + pure (updated valids, s', leftmost [keyClosings, mouseClosings, enterClosings]) pure (updatedS, closings) safeIndex :: Int -> [a] -> Maybe a