forked from janek/mostr
1
0
Fork 0

Automatically move up a task on invalid input

This commit is contained in:
xeruf 2024-07-18 00:39:22 +03:00
parent a0c46b6ea1
commit d74c20fc04
1 changed files with 2 additions and 1 deletions

View File

@ -109,7 +109,8 @@ async fn repl() {
} }
match input.split_once(": ") { match input.split_once(": ") {
None => { None => {
position = EventId::parse(input).ok(); position = EventId::parse(input).ok().or(
position.and_then(|p| tasks.get(&p)).and_then(|t| t.parent_id()));
} }
Some(s) => { Some(s) => {
let mut tags: Vec<Tag> = s.1.split(" ").map(|t| Tag::Hashtag(t.to_string())).collect(); let mut tags: Vec<Tag> = s.1.split(" ").map(|t| Tag::Hashtag(t.to_string())).collect();