stitch

Note taking for messy minimalists

git clone git://mccd.space/stitch
commit 6c54bef75d51070c6c171790f43e02f84641fc8a
parent 964d6773395b7008661b38c11acd24959f280fb1
Author: Marc Coquand <marc@mccd.space>
Date:   Mon, 20 May 2024 09:33:16 -0500

Display search query in title

Diffstat:
Mlib/headlines.ml | 11+++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/lib/headlines.ml b/lib/headlines.ml
@@ -42,7 +42,11 @@ let init ~goto_done_view ~goto_todos_view ~regexp =
     })
 
 
-let title = I.strf ~attr:A.(st bold) "%s" "Notes" |> I.pad ~l:0 ~t:0
+let title ~tag =
+  match tag with
+  | "" -> I.strf ~attr:A.(st bold) "%s" "Notes" |> I.pad ~l:0 ~t:0
+  | a -> I.strf ~attr:A.(st bold) "%s - %s" "Notes" a |> I.pad ~l:0 ~t:0
+
 
 let rec render
   t
@@ -82,7 +86,10 @@ let rec render
         (Basic.array_drop scroll content_pretty)
     in
     let open I in
-    Array.fold_left (fun sum el -> sum </> el) (title </> dot </> output_info) elements
+    Array.fold_left
+      (fun sum el -> sum </> el)
+      (title ~tag </> dot </> output_info)
+      elements
   in
   Common.Term.image t img;
   let content_end = Array.length content_pretty + (content_start - 1) in