From 6c54bef75d51070c6c171790f43e02f84641fc8a Mon Sep 17 00:00:00 2001 From: Marc Coquand Date: Mon, 20 May 2024 09:33:16 -0500 Subject: Display search query in title --- lib/headlines.ml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'lib') 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 -- cgit v1.2.3