From e43cb8b16b856942e864881a6a9fecab1dabb03c Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 6 Oct 2020 21:46:54 +0200 Subject: Much.Action: add moveCursorToThread --- src/Much/Action.hs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/Much') 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)) -- cgit v1.2.3