stitch

Note taking for messy minimalists

git clone git://mccd.space/stitch
commit 60d41f32aff828aee0dd2e04d1c8e0e7fe6764a9
parent eefbe31e308d3c7e031d757951f379c899ca62f6
Author: Marc Coquand <marc@mccd.space>
Date:   Thu, 23 May 2024 13:35:15 -0500

Resolve issue with tag not showing if using -t tag

Diffstat:
Mlib/headlines.ml | 7++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/lib/headlines.ml b/lib/headlines.ml
@@ -18,11 +18,8 @@ type state =
   }
 
 let init ~goto_done_view ~goto_todos_view ~regexp =
-  let tag = if String.equal regexp "" then None else Some regexp in
   let content =
-    match tag with
-    | None -> Grep.get_headlines () |> Grep.parse_headlines
-    | Some tag -> Grep.get_tagged_headlines tag () |> Grep.parse_headlines
+    Grep.get_tagged_headlines regexp () |> Grep.parse_headlines
   in
   if Array.length content == 0
   then (
@@ -37,7 +34,7 @@ let init ~goto_done_view ~goto_todos_view ~regexp =
     ; goto_done_view
     ; goto_todos_view
     ; output = None
-    ; tag = ""
+    ; tag = regexp
     ; hide_file_name = false
     })