rasa 0.1.4 → 0.1.5
raw patch · 5 files changed
+21/−8 lines, 5 files
Files
- rasa.cabal +1/−1
- src/Rasa/Ext.hs +2/−0
- src/Rasa/Internal/Directive.hs +9/−2
- src/Rasa/Internal/Editor.hs +1/−1
- src/Rasa/Internal/Events.hs +8/−4
rasa.cabal view
@@ -1,5 +1,5 @@ name: rasa-version: 0.1.4+version: 0.1.5 cabal-version: >=1.10 build-type: Simple license: MIT
src/Rasa/Ext.hs view
@@ -52,6 +52,8 @@ , newBuffer , nextBufRef , prevBufRef+ , getBufRefs+ , getBuffers -- * Working with Buffers , BufAction
src/Rasa/Internal/Directive.hs view
@@ -11,6 +11,7 @@ , exit , newBuffer , getBufRefs+ , getBuffers , nextBufRef , prevBufRef @@ -32,6 +33,7 @@ import Control.Lens import Control.Monad+import Control.Arrow (first) import Data.Maybe import Data.IntMap as M import qualified Yi.Rope as Y@@ -71,6 +73,12 @@ getBufRefs :: Action [BufRef] getBufRefs = fmap BufRef <$> use (buffers.to keys) +-- | Returns an up-to-date list of all 'Buffer's, returned values+-- are read-only; altering them has no effect on the actual stored bufferrs.+-- This function is useful for renderers.+getBuffers :: Action [(BufRef, Buffer)]+getBuffers = fmap (first BufRef) <$> use (buffers.to assocs)+ -- | Gets 'BufRef' that comes after the one provided nextBufRef :: BufRef -> Action BufRef nextBufRef br@(BufRef bufInt) = do@@ -90,11 +98,10 @@ if M.null bufMap then return br else do- let mLesserInd = lookupGT bufInt bufMap+ let mLesserInd = lookupLT bufInt bufMap case mLesserInd of Just (lesserInd, _) -> return $ BufRef lesserInd Nothing -> return . BufRef . fst . findMax $ bufMap- -- | This signals to the editor that you'd like to shutdown. The current events -- will finish processing, then the 'Rasa.Ext.Scheduler.onExit' hook will run,
src/Rasa/Internal/Editor.hs view
@@ -44,7 +44,7 @@ -- 'Nothing' if a value was expected. newtype BufRef = BufRef Int- deriving (Show, Eq)+ deriving (Show, Eq, Ord) -- | This is the primary state of the editor. data Editor = Editor
src/Rasa/Internal/Events.hs view
@@ -48,10 +48,14 @@ data Keypress = Keypress Char [Mod]- | Esc- | BS- | Enter- | Unknown+ | KEsc+ | KBS+ | KEnter+ | KUnknown+ | KLeft+ | KRight+ | KUp+ | KDown deriving (Show, Eq, Typeable) -- | This represents each modifier key that could be pressed along with a key.