diff options
author | Marc Coquand <marc@mccd.space> | 2024-05-20 09:33:16 -0500 |
---|---|---|
committer | Marc Coquand <marc@mccd.space> | 2024-05-20 09:33:16 -0500 |
commit | 6c54bef75d51070c6c171790f43e02f84641fc8a (patch) | |
tree | 75f5b3c32895c36365d39794d6165d554ebd285d /lib/headlines.ml | |
parent | 964d6773395b7008661b38c11acd24959f280fb1 (diff) | |
download | stitch-6c54bef75d51070c6c171790f43e02f84641fc8a.tar.gz stitch-6c54bef75d51070c6c171790f43e02f84641fc8a.tar.bz2 stitch-6c54bef75d51070c6c171790f43e02f84641fc8a.zip |
Display search query in title
Diffstat (limited to 'lib/headlines.ml')
-rw-r--r-- | lib/headlines.ml | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/headlines.ml b/lib/headlines.ml index 38ff42d..d8d6c9b 100644 --- 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 |