cli on delete todo, write in Done identified by entire struct so dupes wouldnt but thats ok
This commit is contained in:
@@ -167,7 +167,18 @@ func edit(dry bool, filepaths []string) error {
|
||||
return err
|
||||
}
|
||||
original := originals[target]
|
||||
|
||||
newTodoIDs := map[string]struct{}{}
|
||||
for i := range newTodos {
|
||||
newTodoIDs[newTodos[i].ID()] = struct{}{}
|
||||
}
|
||||
for i := range original.Todo {
|
||||
if _, ok := newTodoIDs[original.Todo[i].ID()]; !ok {
|
||||
original.Done = append(original.Done, original.Todo[i])
|
||||
}
|
||||
}
|
||||
original.Todo = newTodos
|
||||
|
||||
original.AutoMove()
|
||||
c, err := yaml.Marshal(original)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user