aboutsummaryrefslogtreecommitdiff
path: root/lib/headlines.ml
diff options
context:
space:
mode:
authorMarc Coquand <marc@mccd.space>2024-05-15 11:05:27 -0500
committerMarc Coquand <marc@mccd.space>2024-05-15 11:05:27 -0500
commit47be0ea3eeb774102f02b5f85ee974afe6a8170e (patch)
treedc24d5c40f0f70d47697fe99ce9250d1187b7226 /lib/headlines.ml
parentff680702db85b3eec539b3be1931f92cbb89fe8d (diff)
downloadstitch-47be0ea3eeb774102f02b5f85ee974afe6a8170e.tar.gz
stitch-47be0ea3eeb774102f02b5f85ee974afe6a8170e.tar.bz2
stitch-47be0ea3eeb774102f02b5f85ee974afe6a8170e.zip
Add way to go back and forth between note and todo view
Diffstat (limited to 'lib/headlines.ml')
-rw-r--r--lib/headlines.ml3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/headlines.ml b/lib/headlines.ml
index 0633a73..954d0e2 100644
--- a/lib/headlines.ml
+++ b/lib/headlines.ml
@@ -50,11 +50,12 @@ let rec render t ({ pos; scroll; content; content_pretty } as state) =
| `Mouse ((`Press _ | `Drag), (_, y), _) ->
render t { state with pos = 0, min y content_length }
| `Key (`ASCII '?', []) -> Help_screen.render t { go_back = (fun () -> render t state) }
- | `Key (`ASCII 't', []) ->
+ | `Key (`ASCII '2', []) ->
let todo_content = Grep.get_todos () |> Grep.parse_todo_string in
let todo_pretty = Grep.pretty_format_todo todo_content in
let todo_state =
Todos.init
+ ~goto_headlines:(fun () -> render t state)
~content:(todo_content |> Array.of_list)
~content_pretty:(todo_pretty |> Array.of_list)
in