summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Alexander Foremny <aforemny@posteo.de>2024-01-11 03:57:34 +0100
committerLibravatar Alexander Foremny <aforemny@posteo.de>2024-01-11 08:12:02 +0100
commit9d913e0f6c4b2e25130b62db94463174199aa443 (patch)
treed3bc1ac4f5d14b635a2f1ce210cf03ae618434f6
parent75ace0b26691848b9a16a9a0ec1880110e8262b8 (diff)
fix: fix interactive tagging
-rw-r--r--app/Main.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/app/Main.hs b/app/Main.hs
index ebf94c9..f9452aa 100644
--- a/app/Main.hs
+++ b/app/Main.hs
@@ -307,7 +307,6 @@ main = do
docs' <-
if
| auto -> processDocuments settings probabilityCache docs
- -- TODO adding tags interactively through prompt does not persist them in store
| prompt -> processDocumentsInteractively settings probabilityCache docs
| otherwise -> pure docs
mapM_
@@ -694,8 +693,10 @@ tagDocumentInteractively settings probabilityCache doc = do
tags <- mapM (uncurry tagDocumentInteractively') suggestedTags
let doc' =
(applyTags tags doc)
- { D.index = doc.index {D.todo = False}
- }
+ & \doc' ->
+ doc'
+ { D.index = doc'.index {D.todo = False}
+ }
R.replaceDocument (printf "process %s (interactive)" doc.iFilePath) doc'
pure doc'
where
@@ -720,7 +721,7 @@ tagDocumentInteractively settings probabilityCache doc = do
pure $
if tagValue == "-"
then Left (G.tagKey tag)
- else Right tag
+ else Right (G.tag (G.tagKey tag) (Just tagValue))
ensureGit :: IO ()
ensureGit = do