aboutsummaryrefslogtreecommitdiff
path: root/lib/headlines.ml
diff options
context:
space:
mode:
Diffstat (limited to 'lib/headlines.ml')
-rw-r--r--lib/headlines.ml11
1 files changed, 6 insertions, 5 deletions
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 ()