From 44e211d18ffeb326694ac1a13f24711bb885f167 Mon Sep 17 00:00:00 2001 From: Jonathan Daugherty Date: Sun, 24 May 2015 12:11:27 -0700 Subject: [PATCH] Export list moveBy and use in demo --- programs/Main.hs | 2 +- src/Brick/List.hs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/programs/Main.hs b/programs/Main.hs index b10c05f..aa87cd6 100644 --- a/programs/Main.hs +++ b/programs/Main.hs @@ -77,7 +77,7 @@ appEvent e st = EvKey KEnter [] -> let el = length $ listElements $ st^.stList - in return $ st & stList %~ listInsert el el + in return $ st & stList %~ (moveBy 1 . listInsert el el) ev -> return $ st & stEditor %~ (handleEvent ev) & stList %~ (handleEvent ev) diff --git a/src/Brick/List.hs b/src/Brick/List.hs index cf10fe9..0a177d2 100644 --- a/src/Brick/List.hs +++ b/src/Brick/List.hs @@ -2,6 +2,7 @@ module Brick.List ( List(listElements) , list + , moveBy , drawList , listInsert )