diff options
author | tv <tv@shackspace.de> | 2015-01-31 17:04:49 +0100 |
---|---|---|
committer | tv <tv@shackspace.de> | 2015-01-31 17:04:49 +0100 |
commit | da7bf1ca587f66857b496f707bc3271cf366fcd3 (patch) | |
tree | e232e522d7cd30d55872457b213fffc460054612 /test5.hs | |
parent | ef48d081dfd0e817c4959dbbd49929ae760a310e (diff) |
toggleTagAtCursor: sync modification
Synchronize modification of tags between Message and SearchResult.
Diffstat (limited to 'test5.hs')
-rw-r--r-- | test5.hs | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -35,6 +35,7 @@ import TagUtils import Trammel import TreeSearch import TreeView +import TreeZipperUtils (modifyFirstParentLabelWhere) import Utils @@ -430,19 +431,21 @@ toggleTagAtCursor tag q@State{..} = case Z.label cursor of else AddTag tagOps = [tagOp tag] Notmuch.notmuchTag tagOps sr - -- TODO reload or patch whole thread - let cursor' = Z.modifyTree (patchRootLabelTags tagOps) cursor + let cursor' = Z.modifyTree (patchTreeTags tagOps) cursor return q { cursor = cursor' } TVMessage m -> do - -- TODO modify search result tags let tagOp = if tag `elem` Notmuch.messageTags m then DelTag else AddTag tagOps = [tagOp tag] Notmuch.notmuchTag tagOps m - let cursor' = Z.modifyTree (patchRootLabelTags tagOps) cursor + let cursor' = + -- TODO this needs a nice name + modifyFirstParentLabelWhere isTVSearchResult f $ + Z.modifyLabel f cursor + f = patchTags tagOps return q { cursor = cursor' } _ -> return q { flashMessage = "nothing happened" } |