aboutsummaryrefslogtreecommitdiff
path: root/lib/todos.ml
diff options
context:
space:
mode:
Diffstat (limited to 'lib/todos.ml')
-rw-r--r--lib/todos.ml14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/todos.ml b/lib/todos.ml
index fd9eaf1..0920829 100644
--- a/lib/todos.ml
+++ b/lib/todos.ml
@@ -93,16 +93,28 @@ let rec render
Input_screen.render t input_state
| `Key (`ASCII '1', []) -> goto_headlines (fun () -> render t state)
| `Key (`ASCII '3', []) -> goto_done (fun () -> render t state)
+ | `Key (`ASCII 'g', []) ->
+ let content, content_pretty = load_todos () in
+ let y = min (List.length content_pretty + content_start) y in
+ render
+ t
+ { state with
+ pos = x, y
+ ; content = content |> Array.of_list
+ ; content_pretty = Array.of_list content_pretty
+ }
| `Key (`ASCII 'j', []) | `Key (`ASCII 'N', [ `Ctrl ]) -> scroll_down ()
| `Key (`ASCII 'k', []) | `Key (`ASCII 'P', [ `Ctrl ]) -> scroll_up ()
| `Key (`ASCII 't', []) ->
let selected_file, _ = Array.get content (y - content_start) in
let _ = Grep.toggle_done selected_file in
let content, content_pretty = load_todos () in
+ let y = min (List.length content_pretty + content_start) y in
render
t
{ state with
- content = content |> Array.of_list
+ pos = x, y
+ ; content = content |> Array.of_list
; content_pretty = Array.of_list content_pretty
}
| `Key (`Arrow d, _) ->