aboutsummaryrefslogtreecommitdiff
path: root/lib/done.ml
diff options
context:
space:
mode:
authorMarc Coquand <marc@mccd.space>2024-05-20 09:37:12 -0500
committerMarc Coquand <marc@mccd.space>2024-05-20 09:37:12 -0500
commit4c895f9e4a8607fb06c712aaca50a82d23eca05b (patch)
tree84bd1e9b0e2ae31ddbd33c51f665a4f494a0f942 /lib/done.ml
parent6c54bef75d51070c6c171790f43e02f84641fc8a (diff)
downloadstitch-4c895f9e4a8607fb06c712aaca50a82d23eca05b.tar.gz
stitch-4c895f9e4a8607fb06c712aaca50a82d23eca05b.tar.bz2
stitch-4c895f9e4a8607fb06c712aaca50a82d23eca05b.zip
Reformat title with search; add to todo and done
Diffstat (limited to 'lib/done.ml')
-rw-r--r--lib/done.ml14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/done.ml b/lib/done.ml
index cda47e4..ea5855a 100644
--- a/lib/done.ml
+++ b/lib/done.ml
@@ -15,7 +15,12 @@ type state =
; hide_file_name : bool
}
-let title = I.strf ~attr:A.(st bold) "%s" "Done" |> I.pad ~l:0 ~t:0
+let title ~tag =
+ match tag with
+ | "" -> I.strf ~attr:A.(st bold) "%s" "Done" |> I.pad ~l:0 ~t:0
+ | a -> I.strf ~attr:A.(st bold) "%s > %s" "Done" a |> I.pad ~l:0 ~t:0
+
+
let content_start = 2
let init ~goto_todo ~goto_headlines =
@@ -49,7 +54,7 @@ let rec render
; goto_todo
; output
; hide_file_name
- ; _
+ ; tag
} as state)
=
let x, y = pos in
@@ -75,7 +80,10 @@ let rec render
(content_pretty |> Basic.array_drop scroll)
in
let open I in
- Array.fold_left (fun sum el -> el </> sum) (title </> dot </> output_info) elements
+ Array.fold_left
+ (fun sum el -> el </> sum)
+ (title ~tag </> dot </> output_info)
+ elements
in
Common.Term.image t img;
let content_end = Array.length content_pretty + (content_start - 1) in