aboutsummaryrefslogtreecommitdiff
path: root/lib/todos.ml
diff options
context:
space:
mode:
authorMarc Coquand <marc@mccd.space>2024-05-29 10:10:45 -0500
committerMarc Coquand <marc@mccd.space>2024-05-29 10:10:45 -0500
commit67c32112317ec80d0a45da245dc54dda59da5de5 (patch)
treebae7370352bf35bc50da9d1021ce52be71fb5311 /lib/todos.ml
parent41e598d5c92ac4687de4c3d700972ecf2096eb60 (diff)
downloadstitch-76d2e9b4edeeb438a97cef6962158434e40cbd6f.tar.gz
stitch-76d2e9b4edeeb438a97cef6962158434e40cbd6f.tar.bz2
stitch-76d2e9b4edeeb438a97cef6962158434e40cbd6f.zip
Bugfix: done and todo should not reset tag when moving something to donev0.0.9
Diffstat (limited to 'lib/todos.ml')
-rw-r--r--lib/todos.ml8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/todos.ml b/lib/todos.ml
index 89f84d7..83a497b 100644
--- a/lib/todos.ml
+++ b/lib/todos.ml
@@ -44,6 +44,12 @@ let load_todos ?(hide_file_name = false) () =
todo_content, todo_pretty
+let refresh ?(hide_file_name = false) tag =
+ let content = Grep.get_tagged_todo tag () |> Grep.parse_todo_string in
+ let content_pretty = Grep.pretty_format_todo ~hide_file_name content in
+ content, content_pretty
+
+
let rec render
t
({ pos
@@ -192,7 +198,7 @@ let rec render
| `Key (`ASCII 'T', [ `Ctrl ]) ->
let selected_file, _ = Array.get content (y - content_start) in
let _ = Grep.toggle_done selected_file in
- let content, content_pretty = load_todos ~hide_file_name () in
+ let content, content_pretty = refresh ~hide_file_name tag in
let y = min (List.length content_pretty + content_start) y in
render
t