diff options
author | tv <tv@krebsco.de> | 2020-10-06 21:46:54 +0200 |
---|---|---|
committer | tv <tv@krebsco.de> | 2020-10-06 21:46:54 +0200 |
commit | e43cb8b16b856942e864881a6a9fecab1dabb03c (patch) | |
tree | da81e9c3d5d7c24522b190a55dadde1bd8fab27c | |
parent | 605687aef387e24c7a4245ad5ba35f58b29878b1 (diff) |
Much.Action: add moveCursorToThread
-rw-r--r-- | src/Much/Action.hs | 11 |
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)) |