From 598ce9ecef91264bd78555bd5b6fcca97a073d95 Mon Sep 17 00:00:00 2001 From: Marc Coquand Date: Mon, 10 Jun 2024 11:58:16 -0500 Subject: Hide file names by default --- lib/headlines.ml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'lib/headlines.ml') diff --git a/lib/headlines.ml b/lib/headlines.ml index 97eab20..6ed3ab3 100644 --- a/lib/headlines.ml +++ b/lib/headlines.ml @@ -24,7 +24,8 @@ let init ~goto_done_view ~goto_todos_view ~regexp = print_endline "Regexp not found"; exit 0) else ( - let content_pretty = content |> Grep.pretty_format in + let hide_file_name = true in + let content_pretty = content |> Grep.pretty_format ~hide_file_name in { pos = 0, 2 ; scroll = 0 ; content @@ -33,7 +34,7 @@ let init ~goto_done_view ~goto_todos_view ~regexp = ; goto_todos_view ; output = None ; tag = regexp - ; hide_file_name = false + ; hide_file_name }) @@ -43,9 +44,9 @@ let title ~tag = | a -> I.strf ~attr:A.(st bold) "%s > %s" "Notes" a |> I.pad ~l:0 ~t:0 -let refresh regexp = +let refresh ~hide_file_name regexp = let content = Grep.get_tagged_headlines regexp () |> Grep.parse_headlines in - content, content |> Grep.pretty_format + content, content |> Grep.pretty_format ~hide_file_name let rec render @@ -266,7 +267,7 @@ let rec render match Unix.wait () with | _, _ -> Common.Term.cursor t None; - let content, content_pretty = refresh tag in + let content, content_pretty = refresh ~hide_file_name tag in render t { state with content; content_pretty } (* Capture resizing events *) | exception Unix.Unix_error (Unix.EINTR, _, _) -> run_editor () -- cgit v1.2.3