stitch

Note taking for messy minimalists

git clone git://mccd.space/stitch
commit 41e598d5c92ac4687de4c3d700972ecf2096eb60
parent 9ffd8422de06adab52c0b7873a6ce181d82b5391
Author: Marc Coquand <marc@mccd.space>
Date:   Wed, 29 May 2024 09:56:45 -0500

Update todo and done to auto-update

Diffstat:
Mlib/done.ml | 8+++++++-
Mlib/todos.ml | 8+++++++-
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/lib/done.ml b/lib/done.ml
@@ -227,7 +227,13 @@ let rec render
       match Unix.wait () with
       | _, _ ->
         Common.Term.cursor t None;
-        render t state
+        let content, content_pretty = load_done ~hide_file_name () in
+        render
+          t
+          { state with
+            content = content |> Array.of_list
+          ; content_pretty = content_pretty |> Array.of_list
+          }
       (* Capture resizing events *)
       | exception Unix.Unix_error (Unix.EINTR, _, _) -> run_editor ()
       | exception Unix.Unix_error (_, _, _) -> failwith "ERROR"
diff --git a/lib/todos.ml b/lib/todos.ml
@@ -228,7 +228,13 @@ let rec render
       match Unix.wait () with
       | _, _ ->
         Common.Term.cursor t None;
-        render t state
+        let content, content_pretty = load_todos ~hide_file_name () in
+        render
+          t
+          { state with
+            content = content |> Array.of_list
+          ; content_pretty = Array.of_list content_pretty
+          }
       (* Capture resizing events *)
       | exception Unix.Unix_error (Unix.EINTR, _, _) -> run_editor ()
       | exception Unix.Unix_error (_, _, _) -> failwith "ERROR"