summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Much/Action.hs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Much/Action.hs b/src/Much/Action.hs
index 1e4785a..6613eb1 100644
--- a/src/Much/Action.hs
+++ b/src/Much/Action.hs
@@ -4,6 +4,7 @@
module Much.Action where
import Blessings.String
+import Data.Maybe
import Scanner
import Much.State
import Much.TagUtils
@@ -107,6 +108,16 @@ moveCursorToThread q@State{..} =
moveToParent q >>= moveCursorToThread
+moveCursorToFirstOnSameLevel :: Monad m => State -> m State
+moveCursorToFirstOnSameLevel q@State{..} =
+ return q { cursor = fromMaybe cursor . Z.nextTree . Z.first . Z.prevSpace $ cursor }
+
+
+moveCursorToLastOnSameLevel :: Monad m => State -> m State
+moveCursorToLastOnSameLevel q@State{..} =
+ return q { cursor = fromMaybe cursor . Z.prevTree . Z.last . Z.nextSpace $ cursor }
+
+
moveCursorToUnread
:: (Num a, Monad m, Eq a)
=> (Z.TreePos Z.Full TreeView -> Maybe (Z.TreePos Z.Full TreeView))