shuffle code

master
Bel LaPointe 2023-11-06 13:11:22 -07:00
parent bfdeebb7a2
commit 1ce120a647
1 changed files with 11 additions and 5 deletions

View File

@ -19,6 +19,17 @@ func _dump(writer io.Writer, filepaths []string, tags []string, search, rootDisp
return err
}
for _, x := range []*[]pttodo.Todo{
&root.Todo,
&root.Scheduled,
&root.Done,
} {
y := pttodo.Todos(*x)
y = y.LikeTags(tags)
y = y.LikeSearch(search)
*x = y
}
var v interface{} = root
switch rootDisplay {
case DUMP_ALL:
@ -29,11 +40,6 @@ func _dump(writer io.Writer, filepaths []string, tags []string, search, rootDisp
case DUMP_DONE:
v = root.Done
}
if todos, ok := v.([]pttodo.Todo); ok {
todos = pttodo.Todos(todos).LikeTags(tags)
todos = pttodo.Todos(todos).LikeSearch(search)
v = todos
}
b2, err := yaml.Marshal(v)
if err != nil {