forked from janek/mostr
feat: create nonexistent task on entering
This commit is contained in:
parent
9d45525a9b
commit
ab16b87497
10
src/main.rs
10
src/main.rs
|
@ -183,7 +183,15 @@ async fn repl() {
|
||||||
.and_then(|id| tasks.get(&id))
|
.and_then(|id| tasks.get(&id))
|
||||||
.and_then(|t| t.parent_id());
|
.and_then(|t| t.parent_id());
|
||||||
}
|
}
|
||||||
let _ = EventId::parse(&input[dots..]).map(|p| position = Some(p));
|
let slice = &input[dots..];
|
||||||
|
if !slice.is_empty() {
|
||||||
|
position = EventId::parse(slice).ok().or_else(|| {
|
||||||
|
let task = make_task(slice, &[]);
|
||||||
|
let ret = Some(task.id);
|
||||||
|
add_task(&mut tasks, task);
|
||||||
|
ret
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_ => {
|
_ => {
|
||||||
|
|
Loading…
Reference in New Issue