summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2020-10-06 21:46:54 +0200
committertv <tv@krebsco.de>2020-10-06 21:46:54 +0200
commite43cb8b16b856942e864881a6a9fecab1dabb03c (patch)
treeda81e9c3d5d7c24522b190a55dadde1bd8fab27c /src
parent605687aef387e24c7a4245ad5ba35f58b29878b1 (diff)
Much.Action: add moveCursorToThread
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 5872964..1e4785a 100644
--- a/src/Much/Action.hs
+++ b/src/Much/Action.hs
@@ -96,6 +96,17 @@ moveToParent q@State{..} =
i -> moveTreeDown i q'
+moveCursorToThread :: Monad m => State -> m State
+moveCursorToThread q@State{..} =
+ case Z.label cursor of
+ TVSearch _ ->
+ return q { flashMessage = "cannot go further up" }
+ TVSearchResult _ ->
+ return q
+ _ ->
+ moveToParent q >>= moveCursorToThread
+
+
moveCursorToUnread
:: (Num a, Monad m, Eq a)
=> (Z.TreePos Z.Full TreeView -> Maybe (Z.TreePos Z.Full TreeView))