packages feed

spade 0.1.0.4 → 0.1.0.5

raw patch · 4 files changed

+25/−13 lines, 4 files

Files

ChangeLog.md view
@@ -1,3 +1,15 @@ # Changelog for S.P.A.D.E  ## Unreleased changes++## 0.1.0.5+* Fix bug that caused the ide to freeze when the loaded program is run for+  second time.+* Hide autocomplete window as soon as the only suggestion is the same as+  search key.++## 0.1.0.4+* Fix regression that caused step debugging to freeze the ui.++## 0.1.0.3+* Initial proper release
spade.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack  name:           spade-version:        0.1.0.4+version:        0.1.0.5 synopsis:       A simple programming and debugging environment. description:    A simple weakly typed, dynamic, interpreted programming langauge and terminal IDE. category:       language, interpreter, ide
src/IDE/IDE.hs view
@@ -296,7 +296,7 @@                 -- Reset IDE debuggins state                 void $ atomically $ do                   readTBQueue debugIn >>= (check . (== Stop)) -- Wait till the stop command-+                  void $ takeTMVar interpreterThreadRef                   modifyTVar ideStateRef                     (\idestate ->                         idestate
src/UI/Widgets/Editor.hs view
@@ -537,18 +537,18 @@         case ewAutocompleteWidget ew' of           Just (SomeWidgetRef ac) -> do             key <- getAutoCompleteKey (ewContent ew') (ewCursor ew')-            if T.null key-              then do-                withCapability (DrawableCap ac) $ do-                  setVisibility ac False-              else do-              (ewAutocompleteSuggestions ew) key >>= \case-                [] -> do-                  withCapability (DrawableCap ac) $ do+            withCapability (DrawableCap ac) $ do+              if T.null key+                then do                     setVisibility ac False-                suggestions@(_:_) -> withCapability (ContainerCap ac (Proxy @[(Text, Text)])) $ do-                  setContent ac (sortBy (\(a1, _) (a2, _) -> compare (T.length a1) (T.length a2)) suggestions)-                  withCapability (DrawableCap ac) $ do+                else do+                (ewAutocompleteSuggestions ew) key >>= \case+                  [] -> setVisibility ac False+                  [s] -> if (fst s) == key+                    then setVisibility ac False+                    else pass+                  suggestions@(_:_) -> withCapability (ContainerCap ac (Proxy @[(Text, Text)])) $ do+                    setContent ac (sortBy (\(a1, _) (a2, _) -> compare (T.length a1) (T.length a2)) suggestions)                     setVisibility ac True             pure ()           Nothing -> pure ()