aboutsummaryrefslogtreecommitdiff
path: root/lib/done.ml
diff options
context:
space:
mode:
authorMarc Coquand <marc@mccd.space>2024-05-15 14:18:05 -0500
committerMarc Coquand <marc@mccd.space>2024-05-15 14:18:05 -0500
commit613b17e9f30b4def18e014993576a4324d9b11a4 (patch)
treeeada6c85627f617dc226137d0f1a024360ca2baa /lib/done.ml
parente1bdc8f64a16b233a2633b05c2b073169a4c42c4 (diff)
downloadstitch-613b17e9f30b4def18e014993576a4324d9b11a4.tar.gz
stitch-613b17e9f30b4def18e014993576a4324d9b11a4.tar.bz2
stitch-613b17e9f30b4def18e014993576a4324d9b11a4.zip
Add regexp search for done and todo
Diffstat (limited to '')
-rw-r--r--lib/done.ml15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/done.ml b/lib/done.ml
index 6a60fd1..815f663 100644
--- a/lib/done.ml
+++ b/lib/done.ml
@@ -73,17 +73,22 @@ let rec render
| `Mouse ((`Press _ | `Drag), (_, y), _) ->
render t { state with pos = 0, min y content_end }
| `Key (`ASCII '?', []) -> Help_screen.render t { go_back = (fun () -> render t state) }
- | `Key (`ASCII 's', []) ->
+ | `Key (`ASCII 'r', []) ->
let (input_state : Input_screen.state) =
{ screen = img
; user_input = ""
- ; prompt = "GREP: "
+ ; prompt = "REGEXP: "
; on_enter =
(fun tag ->
- let content = Grep.get_tagged_headlines tag () |> Grep.parse_headlines in
- let content_pretty = Grep.pretty_format content in
+ let content = Grep.get_tagged_done tag () |> Grep.parse_todo_string in
+ let content_pretty = Grep.pretty_format_todo content in
Common.Term.cursor t None;
- render t { state with content; content_pretty })
+ render
+ t
+ { state with
+ content = content |> Array.of_list
+ ; content_pretty = content_pretty |> Array.of_list
+ })
; on_cancel =
(fun _ ->
Common.Term.cursor t None;