aboutsummaryrefslogtreecommitdiff
path: root/lib/headlines.ml
diff options
context:
space:
mode:
authorMarc Coquand <marc@mccd.space>2024-05-29 09:51:57 -0500
committerMarc Coquand <marc@mccd.space>2024-05-29 09:51:57 -0500
commit9ffd8422de06adab52c0b7873a6ce181d82b5391 (patch)
tree84d092603ffd984ee8ef1073972946a708010579 /lib/headlines.ml
parent4aea286edd92845f17c490e1009cd8f7e271e596 (diff)
downloadstitch-9ffd8422de06adab52c0b7873a6ce181d82b5391.tar.gz
stitch-9ffd8422de06adab52c0b7873a6ce181d82b5391.tar.bz2
stitch-9ffd8422de06adab52c0b7873a6ce181d82b5391.zip
Refresh when editing in stitched and headline view
Diffstat (limited to '')
-rw-r--r--lib/headlines.ml8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/headlines.ml b/lib/headlines.ml
index cefe31d..3c94f12 100644
--- a/lib/headlines.ml
+++ b/lib/headlines.ml
@@ -43,6 +43,11 @@ let title ~tag =
| a -> I.strf ~attr:A.(st bold) "%s > %s" "Notes" a |> I.pad ~l:0 ~t:0
+let refresh regexp =
+ let content = Grep.get_tagged_headlines regexp () |> Grep.parse_headlines in
+ content, content |> Grep.pretty_format
+
+
let rec render
t
({ pos
@@ -252,7 +257,8 @@ let rec render
match Unix.wait () with
| _, _ ->
Common.Term.cursor t None;
- render t state
+ let content, content_pretty = refresh tag in
+ render t { state with content; content_pretty }
(* Capture resizing events *)
| exception Unix.Unix_error (Unix.EINTR, _, _) -> run_editor ()
| exception Unix.Unix_error (_, _, _) -> failwith "ERROR"