From 9d913e0f6c4b2e25130b62db94463174199aa443 Mon Sep 17 00:00:00 2001 From: Alexander Foremny Date: Thu, 11 Jan 2024 03:57:34 +0100 Subject: fix: fix interactive tagging --- app/Main.hs | 9 +++++---- 1 file 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 -- cgit v1.2.3